godotengine / godotengine/godot
Rigidbody3d _impulse methods do nothing when called before its _ready and Jolt Physics is selected in project settings
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in Godot 4.6, 4.7
### System information
Godot v4.7.stable - Steam Runtime 2 (soldier) 2 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (nvidia) - AMD Ryzen 7 5800X 8-Core Processor (16 threads) - 15.52 GiB memory - PulseAudio (44100 Hz, Stereo/mono)
### Issue description
While using the Jolt Physics engine, calling any of a RigidBody3D's _impulse methods (i.e. apply_impulse) just as the body is instantiated (i.e. calling an _impulse inside its _init method or from another node) will have no effect on the body.
This issue seems to not apply to RigidBody2D's impulse methods
### Steps to reproduce
Create a scene with a rigidbody3d node.
Call one of the _impulse methods on it in the _init() method.
If using Jolt Physics, the body will not budge, otherwise it will perform the impulse
Alternatively you can instantiate a packed scene, which has a rigid body, and call an impulse on that to see the issue (this is where I met with this problem)
### Minimal reproduction project (MRP)
[bugtest.zip](https://github.com/user-attachments/files/29672663/bugtest.zip)
Contributor guide
Research direction
Start with the RigidBody3D _impulse methods and their behavior during _init, comparing the Jolt Physics path with the non-Jolt path and the reported RigidBody2D behavior. Use the attached bugtest.zip to reproduce an impulse before _ready; done means the impulse affects the body when Jolt Physics is selected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100