godot icon indicating copy to clipboard operation
godot copied to clipboard

Erratic Vehicle Physics

Open MrMinimal opened this issue 3 years ago • 1 comments

Pre collision / free falling: Screenshot from 2022-03-29 17-56-41

Godot version

4.0.alpha.5

System information

Ubuntu 21.04

Issue description

Observed behaviour A VehicleBody3D with multiple VehicleWheel3Ds flys off the second a collider is hit.

Expected behaviour The vehicle would come to rest, with the suspension dampening the fall after a couple of seocnds.

Post collision / just before flying off into the distance: Screenshot from 2022-03-29 17-56-09

Steps to reproduce

  1. Open the reproduction project
  2. Start the reproduction project
  3. Observe free fall
  4. Observe vehicle very much not coming to rest

The example project contains a basic VehicleBody3D vehicle with 6 wheels added. Only wheel radii were adjusted and moved to the meshes correct posion.

Minimal reproduction project

godot-vehicle-demo.zip

MrMinimal avatar Mar 29 '22 16:03 MrMinimal

I had the same problem it was fixed by resetting all of the transforms, and moving only the wheels into place. The cause was a collision shape with non-zero transform, but I didn't move that collision shape it inherited his transform from the mesh I used to create the collision shape, so now that brings me to the point. Your chassis (aka VehicleBody3D) doesn't have a collision shape which is needed, but the editor doesn't give a warning :) This is how I did, and it works: image (The script is only there to change steering, and engine_force with WASD) Btw you might want to change the wheels suspension stiffness :D

ThomasT75 avatar Sep 19 '22 15:09 ThomasT75