Stuck on vehicle creation

Its a tad smaller than the shootergame guy(to his waist), but not so much that i’d imagine it would screw with physics, could be units maybe, but my 3dsmax settings are centimeters, which is correct right?
If i set all the physics bodies to default, the car falls onto the surface then rolls around as if the wheels are spheres, and if i set the wheels to kinematic, it bounces away.

should the wheelS extend below zero height?

ok taking that you say it bounces away, to me that only happens if the main root bone is not at 0,0,0 also chech the alignment of the pivots axis x=forward z=up

when you set up the vehicle have it as if its sitting on the road , eg the wheels are on the road the chassis is above the road

ok, latest update, i restarted with a new test car from 3dsmax, being very careful in setting it up.
Got it in to editor. Got everything to work, something must have been wrong with the old model, but i do not know what.
Problems still facing, its somewhat above the surface, i will go through that tomorrow, as Ive seen someone else has had that problem.

I think I solved through the radius of the wheels, now to the next problem, a turret and turret controls. I’m guessing ill need to add a turret and barrel mesh to the car mesh… Setup controls so that the turret follows the mouse. Then attach the camera to the turret?
Any tutorials or examples on ? Havn’t found much useful info yet.

I’ve made the turret part of the vehicle mesh, how can i reference the turret in bp?

nope i tried myself and failed, i’m not good with code or blueprints so sorry i can’t help there :frowning:

The only useful information about turrets i’ve found is .Blueprint Creating a Tank | Live Training | Unreal Engine - YouTube
Here they seem to have set up sockets that they attach other meshes too, and the turret mesh is available in the bp.

Watch around 14:50. (I truly dislike having to learn stuff from videos)

yeh watched that a while back, ok for a simple vehicle, i asked about using a skelmesh and the answer i got was to try blendspaces for the turret !!!
tried doing it the ue3 way but a lot of the skel controls don’t exist in ue4, at times its like having to re-invent the wheel

Well using a different mesh isn’t the end of the world. I’ll try it tomorrow.

So a small update, I’ve gotten a turret and a barrel to work.

How I did, I remade the 3dsmax asset, removed the turret and barrel from the base vehicle, placed a box(pseudo-bone) where i wanted the turret to be(i set it to not being renderable, but it still shows up in unreal, how do i make stuff invisible?).
Made two new files… one for car_turret and one for car_barrel.( is probably not necessary but made things clearer for me while experimenting, if you do it all in one file simply do not link the stuff you want to end up in different meshes.

The car_turret mesh got a pseudo bone i called barrel, and the car_barrel got a pseudo bone called muzzle(for future… stuff i dont know, and projectile spawns?)

I reimported everything, the car_turret and the car_barrel as skeleton mesh (no idea if is needed).

blueprinting. So drag in the turret and barrel mesh into the car_blueprint components. Set them up with the right parentage, link them to the right parent socket (its done in the details on the right hand side).

Now for the controls:

Add Input axis turn. and Add local rotation(mesh whatever you called the turret). Link them. Now you run into a problem, the axis’ float value is not compatible with the rotator… stumped for a while until I found that if you right click on the rotator and chose “split struct pin”, now you can drag your float to any of the axis you like.

for the barrel its almost the same.

Add Input axis Lookup(although it gets inverted imo). and Add local rotation(mesh whatever you called the barrel). Link them. right click on the rotator and chose “split struct pin”, now you can drag your float to any of the axis you like.

now that is very interesting Ottosson i’ll give it a try later in the week when i have more time.
in max you could try using dummies and convert them to bones on export, we did it that way for ut3 , here’s an old written tutorial but you’ll have to use fbx to export https://sites.google.com/site/ut40kmod/UT40k_mod/ut3-tutorials-1/ut3-cw-part-1

or use max objects like in old one https://sites.google.com/site/ut40kmod/UT40k_mod/ut3-tutorials-1/ut3-cv-part-1

Suggestions on how to make it shoot? :3

How I did it was to spawn an actor on button press or release, with that actor having a projectile movement component. IIRC, I believe I mentioned that in the tank livestream video referenced above.

FWIW:

If I understand your setup correctly, no, it doesn’t have to be a skeletal mesh. Looks like you are offsetting the rotation, which should work for any component with a transform. is basically how I drove the turret rotation of the tank in the stream, though I used static meshes.

Since the tank training livestream, I have been working on a scratch built, skeletal based, physics driven tank, not based on wheeled vehicle. In new tank, the body, turret, treads, and wheel pieces are all part of one skeletal mesh. I drive the turret rotation by manipulating the turret bone via an animation blueprint. Ultimately, I will document, release and do a livestream over it, but for now, here’s a sneak preview:

Turret Rotation:
From my tank BP’s event graph, I set a variable called TurretRotation. The value of variable is set by adding the input of a LookRight Axis Event, which is bound to horizontal mouse input.

The Skeletal Mesh Component of the Tank Blueprint references an animation Blueprint, which I have named AnimBP_Tank_sk

Tank_002.PNG

From the Event Graph of the Animation Blueprint, I cast to the Tank Blueprint, (SpringyTank_00) and get the value of TurretRotation. then sets a variable in the Animation Blueprint named AnimTurretRotation.

In the AnimGraph of the Animation Blueprint, I then get the value of AnimTurretRotation and turn that into a rotator, which is then used to directly modify the rotation of the turret bone’s transform via a Transform(Modify)Bone graph node.
(NOTE: You can’t split the pins here. There’s a bug which requires the incoming value to be composed in a vector/rotator/struct. It has been logged and is slated to be fixed.)

The bone we want to modify is set by name and the method by which the manipulation is applied to any existing animation is set in the details panel of Transform(Modify)Bone graph node. I also disabled Translation and Scale pins, to keep things tidy.

EDIT
I should mention: As the turret bone will be driven by the animation system, the physics simulation needs to be disabled for to work. I did it on Begin Play.

Tank_005.PNG

RESULT: The horizontal mouse drives turret rotation.

When you do release documentation, please make it in writing as well. I find it very hard to work from videos, to find the solution to a problem I’m facing at any particular moment in a movie is really irritating. All these video tutorials drive me mad :stuck_out_tongue:

thanks Alan thats what i was trying to do but didn’t know about having to “cast” , i’ll give it a run at weekend, info will also help me with the UT side-project

I just updated my post with a key piece of info at the bottom.

There’s a possibility that I may have left out some other piece of the puzzle that makes all work; new tank has been a work in progress stretched over a number of weeks. Post if you get stuck, and I will try to help.

Vehicles are complicated! :slight_smile:

just to let you know it works a treat i’ve even add limits to the pitch :slight_smile: , can’t get it to work in ut though :frowning: no idea whats wrong there

Cool, good to hear! Where and how did you add it? I typically use a clamp on the float before setting turret rotation.

Not sure why it wouldn’t work on UT; I have not had opportunity to delve into it yet.

after an hour messing about i had to add the convert to local and convert to componant in the ut version now it works

you guessed it i added a clamp in the vehicle bp between the inputaxis and the set, to double check the value was being read/passed i added a print string after the set, first in the bp then in the animbp just to make sure

funny thing was that i didn’t need the converts in the animgraph in the ue4 version !!!