Joint wobble with 2 or more joints?

Hiya

I’m attempting to build a bike, but having trouble with the basic physics rig setup for steering (and imagine I will encounter issues with suspension too)

For now, I have a box for the body, and spheres for the wheels as components in one actor.

Fixing wheels to the body with a PhysicsConstraint at the center of each wheel works as expected, and with a little balance I can roll along happily - however I would like my front wheel to steer - so I’ve inserted another physics body at the center of the front wheel.
The new body (axel) draws a mesh, has collisions enabled (which for some reason seems necessary for physics to work?) but is set to ignore collisions

My initial attempt, the axel wobbled like crazy, when I re-ordered the constraints (putting the axel and its constraint as a child of the body) the axel would remain stiff, but the wheel now wobbles.

Is there some way to make chained constraints work reliably? I’m interested in other solutions for steering but I’d still like to know what is going on here.

(ref, old thread, sounds like the same issue: Using multiple physics constraints - they wobble! - C++ - Unreal Engine Forums

Check this doc from Physx regarding constraints:
http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Joints.html#configuring-joints-for-best-behavior
on to of that, take into account that UE4 scales drive forces by mass of the constrained objects.
Some people managed to make stable setups but it takes a lot of tweaking and experimenting just to make a single rig work in acceptable way. Physx folks recommend to use articulations http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Articulations.html for where joint stability is highly desirable, currently its available in physx but not exposed in UE4.

BoredEngineer - Thanks, the “best-behaviour” link helped me improve things… slightly - but still no-where near an acceptable level.

articulations sound like they would be a working solution - but I’d be amazed if there is not already a way to do a similar thing with UE4!

I’ll make a new post more broadly about doing an axel for a rolling wheel with steering and suspension - still, if anyone has any more insight on how to make a series of constraints work in a decent manner - I’m all ears!

I have example of tank in MMT (link in signature) with suspension based on multiple parts connected by physics constraints. I’ve managed to configure them so that whole thing works without too many issues but abandoned it in the end as the was still very small wobble happening. Speculating that reason for such behavior is wheels slightly clipping into the ground on every frame and then getting pushed out. Switching to custom springs with asymmetric forces applied to chassis and suspension, didn’t helped much either. On top of that, there is unresolved issue with physics bodies colliding with segments of landscape, which leads to wheels or other parts jumping on landscape quite rapidly if you are driving fast. So at the end of the day I’ve switched to using raytraces and sweeps.

But if you look at what @Cristineltrl achieved:https://youtube.com/watch?v=LRheMV3Jx_gthen I must say that stable rig is possible.

Ach, Just encountered the issue of colliding with segments of the landscape!
@Cristineltrl seems to have these issues solved - and links to this: https://www.youtube.com/watch?v=qOe3lYCA1YA&feature=youtu.be
Which I hope will contain some answers (<insert old git grumble about people doing videos instead of write ups here>)

/me watches a good bunch of the video

Fantastic!! The key feature I was missing was oddly in the collision type of the axle.

I had set “collision enabled” to “query only” - which sounded sensible, as I desired no collisions, but it seems to require collisions of some sort to simulate the physics.

Changing “collision enabled” to “query and physics” then ticking “ignore” for all collision types has totally fixed my wobble!

I am mystified as to why this may be, but am extremely happy I can now get the the core functionality of making my bike steer and balance correctly. I’m aiming to do both a “fully manual” mode, where the user directly manipulates balance and steering, as well as an automatic mode, where the user controls the camera, with the bike attempting to balance and steer to match.

Thanks again, @BoredEngineer, @Cristineltrl and UnrealTek ( https://www.youtube.com/channel/UCX44PoFn-gUJ2_8VYAaVrbw )

I hope anyone else trying to do complex constraints, steering joints, suspension and wheels with proxy bodys that have mis-configured collisions may happen across this thread and solve their problems too :slight_smile:

And a tiny quick video to show the system working, with steering controled by the balance system: https://youtu.be/7lyu1qs0qB4

I wish you would sell that bike blueprint on Unreal Store!! :slight_smile: Can you help me figure out how to make the bike stay up right, see below video. I cannot figure out how to get the lerp to work with the current bike position.