Vehicle stuck on spot, jittering

Right, it’s 3 in the morning and I am completely stumped and exhausted.

I’m following Unreal’s vehicle setup tutorial (Vehicles: Overview & Car Setup | 01 | v4.2 Tutorial Series | Unreal Engine - YouTube) and 8 minutes in I am in a complete no-go position. I’m working with a custom vehicle mesh, but I mimicked the tutorial file’s setup (mesh hierarchy, no actual joints/skinning). Once I launch the game in the editor viewport I see my car fall down slightly and it just gets stuck there - it seems to even sink into the floor just a tiny bit. To top that off I get awful jitter, what I first assumed was something to do with the spring arm in the blueprints, but scratched that out; I think my best guess at point is it’s something to do with the either the physics asset or the mesh itself.

I’ve tried leaving the physics asset as it was shown in the video, i.e. capsules+box, but then I switched to hulls cause they seemed to work better in the preview (either way result in game was the same). I tried reworking the meshes in Maya multiple times, lifting them up, rotating, changing the up direction, freezing transformations etc., again no change in results. My blueprints and settings seem to be setup correctly as well.

I literally have no more ideas on what to do, I always seem to run into multiple problems whenever anything involving a rig is at hand. I do hope you guys can help me out here, cause my sanity levels are pretty much drained out by now :eek: !

Might be worth posting a screenshot of the physics asset in PHAT or something that might help us to help you :slight_smile:

It’s possibly it’s the way the physics asset is setup. Been working with Ragdolls lately and the physics asset can be a right SOB to get right to stop any jittering and exploding. Have you got any overlapping physics bodies and if they are overlapping are they set to collide with each other?

make sure the wheels are kinematic in the physics asset and the correct wheel bone names are in the vehicle blueprint.

Right, so is how my mesh looks like and its corresponding physics asset:

That’s a multi convex hull for the body and a single convex hull for the wheels. As I mentioned I tried using simpler means, but the result’s the same.

is my vehicle blueprint setup, seems to match up:

is what I get when I simulate the physics asset with the wheels set to default - the vehicle seems to sink just ever so slightly, I think:

And is the vehicle supposed to start spinning round itself when the wheels are set to kinematic? :confused:

Tried to further play around with multiple settings and the .fbx file, but still a no-go.

ok make sure to root pivot point is at 0,0,0

wow that behaviour does look a bit quirky :slight_smile:

There you go Teggers, you were saying it was hard to get the vehicles to roll, old boy has managed it in PHAT :wink:

Bit of a tricky one to diagnose by looking at the pictures I was hoping it would be something a bit more obvious. Defo try what Geodav says if you havn’t already, might be worth doing a screenshot with the bones displayed on aswell.

I notice you have 4 separate physics bodies on the car body mesh, are they set to collide with each other at all? I imagine they are overlapping so they wouldn’t want collision enabled between themselves.

Now I’ve not messed around with vehicles in PHAT so might not be the same but in regards to characters in PHAT the best way to check if it’s going to go wrong is to run the simulate but with gravity off. If nothing moves then that’s a good sign, if as soon as you turn ‘simulate’ on and things start moving/jittering/exploding then it’s usually a problem with the physic bodies setup in PHAT i.e. the physic bodies are overlapping so they are trying to move away from each other.

In addition to suggestion, you dont need such detailed bodies for the wheels, just use sphyls. And you dont need to set them to Kinematic.

Thank you for the responses guys. Well, the pivot point is definitely at 0,0,0:

Not sure on how to capture the bones though - they’re not being shown in PHAT and I can only see the root bone in the skeletal mesh window (it’s at 0,0,0). (*sorry I’m being a bit of a noob here, I’m specializing in environments, I have no clue how I end up dealing with rigs).

I gave the tires sphyls like you mentioned and took kinematics away. With gravity disabled everything stands still, so I’ll assume that’s a good sign. With gravity everything falls down and the wheels eventually topple towards the center.

I’m guessing you are speaking of the collision response, as that’s the only setting I found that’s close enough? That’s enabled at the moment, but if I disable it for the four pieces, the car body falls through the floor and I’m left with four wheels doing some sort of jiggle dance on the floor! Hilarious in itself, but not really useful :smiley:

It should drop and stand still without the wheels going nuts with gravity enabled. Can you open up the skeletal mesh and post a screenshot with show bones enabled?

There you go:

I’d assume the bones shouldn’t all be crammed in one spot, but yeah, that’s the setup I got with Unreal’s import.

Yeah, that seems to be the problem. Wheel bones should stay where they are when you import, that is wherever the wheels are. can be caused by many things on modelling software side, resetting Xform(or freezing transformations i think?) is one of them so you’ll have to go through your export process again until you get the bones imported properly.

yep you need to center the wheel pivots to the center of the wheels , not being a maya guy can’t help on that.

is one of the reasons i prefer to use a bone/joint rig.

ps. nice Bug :slight_smile:

Ah but I have no bones in the maya file, I’m following the tutorial and it says to check ‘Import Rigid Mesh’ in the prompt screen, which then tells UE to generate the skeleton for you (assuming you have the right mesh hierarchy)?

Thank you :slight_smile: The wheel pivots are centered, although I think I froze transformations at some point, cause the wheels are being shown as being at 0,0,0 now, and I’ll assume it shouldn’t be that way? Although when I checked the file that was given with the tutorial, the transformations seemed to be frozen as well (I do remember seeing the wheels having coords of 0,0,0 EDIT: double checked, actually my brain was lying, no they weren’t).

By bones i mean the hierarchy. For instance, in Max the wheels’ pivot points are at their own center, and all the wheels are linked to the body of the car. When i import it like with Import Rigid Mesh enabled, the body becomes the root bone and the wheels child bones. The thing you should be careful about when you do is to freeze transformations before you link anything if you scaled, moved or rotated the meshes in Maya at some point(and the same thing goes for Max as well.)

Oh man I think I fixed it. Thank goodness I had loads of file iterations for the car, I backtracked a little and only froze the coordinates on the car body, while only freezing scale and rotation on the wheels. Now the car’s not colliding with anything and actually going places :slight_smile: (a bit too enthusiastically, but that’s better than what I had at the start). I’m just used to freezing transformations on all meshes once I’m done with them, but I guess is going to teach me for not paying enough attention at my rigging lectures.

I have a second odd now though: I have the spring arm+camera attached to the mesh, but when let’s say I turn to the right, the camera turns to the left instead?

Go into the Components tab inside the blueprint for your vehicle and select the Camera, in the details below make sure “Use Control Rotation” is turned off, should stop that from happening. :slight_smile:

Superb, worked like a charm :slight_smile:

I just finished off the tutorial setup, and it seems the basics do work now, but I think the vehicle’s now slightly floating above the ground:

And when you actually start going, once it’s accelerated enough the wheels sort of pop out:

Don’t think that’s standard behavior?

You probably need to decrease the wheels’ shape radius in your wheel BP’s. And that rising as you accelerate stuff is a known Epic is aware of.

Go into the front and rear wheel blueprints and try adjusting the “Shape Radius” to a smaller value and test it again, the engine uses value to determine the wheel size.

If that doesn’t help, make sure in the vehicle mesh you have the bottom of the wheels right at 0 on the Z-axis. I believe you can also adjust in the engine by opening up the skeletal mesh and using the transform gizmo (press w on the keyboard) to lower the car down a bit.