Hi all, I am very new to all this but ran out of resources to find a solution for my issue (including all the AI bots out there).
I am trying to build a simple wheel + vehicle mechanic and control. Movement is simply forward/backward/left/right.
I am able to steer the wheel left (testing with left only, will replicate a working solution to steer right), and i am able to return the wheel to its previous original position with the key to steer left is no longer pressed, but both the steer AND returning the wheel back exert a force that is big enough to move the whole vehicle. I tried different things; playing with mass, friction, etc. nothing worked.
Am i doing this the wrong way? should I not try to steer using physics and try to change the rotation of the mesh and sync the physics body and pray things will work out?
Seems like alot of extra stuff… You should be able to accomplish the same thing with just a rigidbody and four raycasts for the wheels… Thats how most physics based driving games are made. For example Ammo.js uses btRaycastVehicle class. Here is an older Ammo.js I created before:
Thank you for the resource, very helpful - though a bit of an overkill for me. I don’t need suspensions and all that complex mechanics. I just need forward/backward/left/right movement, think of a warehouse robot kind of motion
a few examples:
There won’t be high speeds or drifting or racing in this at all.
Not sure if that changes anything but thought I’d share more about the use case.
Me 2 … I used @RaggarHavok Raycast Vehicle Physics as a guide to create my Havok Raycast Vehicle… I added a bunch of stuff I had in my custom ammo builds for high speed driving and smooth surface collisions.
My version is heavily modified to give you that fast paced and high speed need for speed style racing. But take a look at Ragger playground, its a great place to start
Your implemention looks better than mine indeed ^^ My stearing works more like a tank than a car by rotating the wheels in opposite directions, so that might not be what you want
@CrashMaster I loved your implementation, I couldn’t use it because 1) couldn’t turn while moving forward/backward and 2) need to visualize the wheels turning