godotengine / godotengine/godot

VehicleBody3D completely annihilates itself when freezing and unfreezing the underlying RigidBody3D physics when any wheels are touching the ground.

Open
#92,891 0 comments 0 reactions 0 assignees View on GitHub
needs testing topic:3d topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible in Godot 4.2.2.

### System information

Windows 10 Godot 4.2.2 Forward +

### Issue description

The actual effect is difficult to ascertain, but when viewing from a camera that is not in any way attached to the vehicle and continuously resetting the position of the vehicle, the wheels are stuck floating in the air, and the moment the collision shape touches anything all physics related values like `global_position`, `linear_velocity`, `angular_velocity`, and quite a few other values all become Vector3's filled with `nan`.

Expected behavior:
The vehicle should unfreeze from the physics pause and work normally.

If no wheels are touching the ground when the vehicle is frozen and unfrozen, then this issue does not present. The duration the vehicle is frozen and unfrozen does not seem to matter.

### Steps to reproduce

Steps to reproduce:
1. Download the Truck Town starter sample.
2. Run the game and select any vehicle.
3. Open the remote node tree view and navigate to `/root/TownScene/InstancePos/car/Body`
4. While the vehicle is on the ground (resting or otherwise) check and uncheck the Freeze property under the RigidBody3D section.

Observe that your speed becomes -nan and the game's ability to render is completely destroyed. The audio listener also freaks out and the engine sound is lost as well.

### Minimal reproduction project (MRP)

The Truck Town sample project is sufficient as a minimal repro project.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the Truck Town sample, using the remote node path /root/TownScene/InstancePos/car/Body. Toggle the RigidBody3D Freeze property while the vehicle is touching the ground and inspect the physics values for NaN results. Done means freezing and unfreezing the VehicleBody3D leaves its position, velocities, rendering, and audio functioning normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.