I did a similar setup for 10 wheeled truck and wheels kept going crazy at high speeds. The only thing that would make them stable is to completely remove their friction. I’ve decided to simulate friction myself but run into a problem of not being able to calculate wheel load because of this bug:
So I’ve ended up with simulating suspension manually as well.
More specifically the problem is that friction is applied to wheel and then propagates through chain of your constraints to the main body. For this to work correctly you need to scale the mass of connected objects in such a way that it’s as close to 1:1 ratio as possible. One way is to fiddle not with mass but with ‘mass scale’ property. Unfortunately this leads to a setup where 30 ton truck has a 3 ton suspension axles connected to 3 ton wheels.
Duncan, there was a project you could download. which had the basics of this, but now it can’t be downloaded. this was the forum page. I downloaded it months back and learn’t how it was done, thanks to the publisher Polyplant all the credit for the tutorial project is to him. I have just uploaded the rar file to my mediafire account so you and others can download it. Also this project is for engine version 4.7
Thanks Sean. I remember reading that thread after the first post what it is now (nothing but pictures) so I was a bit confused as to what was going on. I will be downloading that sometime tomorrow, thank you.
Very nice! I like how most of the parts are connected to each other instead of being single solid body. The wheels are turning a little to fast, are you using SetAngularTarget of constraint for steering?
Btw, any tips on getting more stable constraints? From my last experiment with aerosled I got much more stable behavior by adding sockets and adding them to physics constrain parameters.
For the constraint stability one of the most important things were this settings on all the truck parts
And the Constraint Projection Values are set to 0.1 for the Projection Linear Tolerance and 1.0 for Projection Angular Tolerance
Another very important thing is Sub-Stepping. I set 16 steps and Max SubStep Delta Time to 0.016
Initially the Max SubStep Delta Time was set to **0.016667 **which was perfect at 120 FPS but when I dropped the frame rate to **60 FPS **the wheels were getting pushed into the ground and jumping around this problem got fixed by changing the Max SubStep Delta Time to 0.016
But now I’ve changed it a bit. When you enable “limited” on angular constraint, you can call “SetAngularTarget” in degrees for it. The nice thing is that you can change this target in real-time, so when I want to turn right I simply start to slowly increase target yaw degrees and constraint will just hold it in that position. I’ll post screenshot of blueprint when I get home, or you can grab a project from github repo GitHub - BoredEngineer/UE4_Tracked_Vehicles: Custom tracked vehicles for UE4, NOT based on PhysX Vehic, blueprint is called Aerosled.
These are really cool tutorials! Thank you for the link.
I’ve never seen such bug before. My guess is that you have a problem with one of the physics settings like “UpdatePhysicsVolume” where it needs to keep recalculating some sort of bounding box, when you drive straight along one of the axis then bounding box keeps it shape. This is just a guess.
Do you have any other blueprint code there except for the steering?