I’m working on a project and want to make vehicles which I have extreme control over. I more or less want a vehicle which behaves like karts from Mario kart. I don’t want them to flip or really have “physics” interactions. I’m pretty sure that this means I can’t use the vehicle movement component that already exists in UE4 or any physics stuff outside of collision (so no Add Torque?). Am I over thinking this? I’ve considered just casting a ray and aligning the car that way but idk about performance there or any issues that may cause. Thoughts?
I have essentially implemented this. Here was my initial direction I took.
Iv’e done it in blueprints and have fantastic control over how the vehicle behaves with small tweaks. Take a look there ^
Two obvious things:
The game looks really great aside from obvious “still in development” quirks. Edit: Lol. The game “looked” great back in August of last year >-> eh hem. (subbed)
The video was excellently done from a consumer standpoint (someone who isn’t interested in making a game but is interested in how they’re made nonetheless).
From a developer standpoint… I loved the concepts. But every step had about half of what I needed missing. :l
HOW does one set the center of gravity?
What type of force are you using to make the suspensions work (assuming it’s just raycast from xyz and then apply force at that xyz). Just standard Torque?
When it comes to turning are you calculating the angle of the torque based on the player’s steering and then just hitting the car at that angle with an Add Torque node? Orr?
How are you even doing the friction and whatnot? Are you getting the material from the object the raycast hits and then altering the “physics” of the vehicle?
This video felt so tangibly close to a solution that it was only until I finished the video and began to think about the actual implementations that it all fell apart. I VERY much appreciate the video and your response but as far as my problem goes it’s still very real
Heh. Or Unreal.
It is all there, but you have to try some experimenting to help fill in some of the gaps in thought.
Unreal has a built in COM variable for physics objects in the details panel.
Add force for throttle. Add torque for turning. Add force for counter force opposite vehicle direction to simulate friction. Add force up the suspension based on compression for a spring system.
thanks very much! I can hopefully take it from here. I really appreciate your help man. Also, props to the artists at Spacedust! (I mean, not just them but I really like the creativity of all of the assets)
I’m really sorry to bother you (again); I know that you didn’t sign up for this xD
I can answer any questions you have or make this as easy as you need it to be; I’ve also included the UASSET file for the object in question. I did this on a (very) fresh Unreal Engine 4.10.1 (Had to reset Windows due to a corrupt update that couldn’t be fixed).
I only ask because I’ve really poured myself into this ever since my post. No matter how much tweaking I do it isn’t fixing it.
I’m a bit confused on what is going on after you got your raycheck results (partially because I’ve watched it on a phone). The general idea is to use lenght between the furthest point of suspension expansion and collision point as a ratio for suspension force. For full illustration check my other post:
Simulating both spring and damping is super important, without dampener your suspension will keep oscillating.
Feel free to check code, it’s on a github. The most readable would be Suspension component in Aerosled folder.
I got inspired by Osok’s video! Thank you for that!