Open JustElectron opened 4 years ago
Can anyone still reproduce this bug in Godot 3.2.3 or any later release?
If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.
Couldn't reproduce the issue in 3.2.3. Tilting works well. Recording :
So closing as resolved. If you can still reproduce in Godot 3.2.4 rc3 or newer, comment with a reproduction project.
For me, this problem exists in all versions, including 3.3.3. I'm attaching a video. The BastiaanOlij project can be used for a test project, where the horizon changes downwards during acceleration: https://github.com/BastiaanOlij/vehicle-demo/tree/Part-4
If necessary, I could do a separate project, but I use Bastian's code here.
Reopening as per above comment.
Same for me as of now. Version 3.4.4 Steam version. I used my own code, so its not the coding I imagine.
@mojoyup Please upload a minimal reproduction project to make this easier to troubleshoot.
@mojoyup Please upload a minimal reproduction project to make this easier to troubleshoot.
Interestingly, I created a simplified test project, same version and it seems to work. I will try to find out in my original what could have caused this and report back, in case anyone has this issue also.
What happened with mine was, when I was changing the VehicleWheel Radius (I scaled everything down, even the models/meshes), then it seems to be "backwards".
The project before scaling and resizing the VehicleWheels worked but Ill try to get more details for it if needed.
VPTest.zip This is the test file. This works if anyone wants to use this
Rule of thumb for physics bodies/collision shapes is NOT to scale them!
The VehicleWheels have the option for such in the parameters. The others were not scaled in the editor, but in Sketchup. EDIT: Meaning that they have the resize parameter. Sorry I didn't specify. EDIT2: I checked just now that all of the Transform scales were not messed with and they are all at "1". So that's good. Good point btw too!
I think I might be able to ahve this closed. I figured out one thing that affects the physics this way. It is the different in the transforms of the parent node (Vehicle), and the children nodes (most likely and mainly the wheels and main collision). I have always put my origin of the children nodes to where the parent node sits on the ground for better control. If it is too exotic of a difference between the parent node Y pos and the children Y pos', Itll start to behave different. I hope that makes sense.
TL/DR: Try to reset the transforms of the children and the parent node(Vehicle) and test/tweak.
UPDATE NOTE: If the VehicleWheel(s) combined y transform is higher than the VehicleBody y transform, it's likely this phenom will occur. Either make the VehicleWheel(s) y transform == VehicleBody y, or make them lower. NOTE: Too low without the proper settings, will cause the wheels to go into the ground/mesh/collision.
The spring physics of the vehicle wheel or body is wrong. When accelerating and braking, the vehicle tilts forward or backward. However this is done in the opposite direction from what is natural. Using a simple setup with a vehicle body and 4 wheels and a static ground plane.
When applying an engine force to the vehicle, the vehicle tilts forward. In real life the vehicle would tilt backwards.
When braking the vehicle tilts backwards. In real life the vehicle would tilt forward.
Here is an example of a vehicle braking