Open RonYanDaik opened 6 months ago
Since we don't have any air friction applied to bodies
Have you turned down physics/3d/default_linear_damp
, or set the linear damp mode to replace? I suspect that is ignored with custom integration
Have you turned down
Oh, no.... No I have not... I've been trying to understand what wrong entire day. After turning it off, it actually started to behave normally in some cases. Probably other cases are just my mistake then.
See the documentation for more details
strange thing happened while i was creating this bug report, the bodies started to fly only half the way
But wait, also i think why this happened. Having _integrate_forces in the class but custom_integrator option off still calls _integrate_forces function.
Please search for a duplicate issue for that and open a dedicated issue report for that
Tested versions
4.1 - 4.2.Stable - 4.3.Preview.6
System information
Godot v4.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.5244) - Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz (20 Threads)
Issue description
It seems like physics engine applies wrong gravity to rigid bodies. (I've tried both Godot physics and Jold3D addon) I'm not an expert at physics but I've never seen physics behave like that in other engines. Since we don't have any air friction applied to bodies, they should follow calculated predicted trajectory matching it.
Bellow I've attached an example project. First GIF is where bodies are solved by the engine. And the don't reach target (strange thing happened while i was creating this bug report, the bodies started to fly only half the way, while just a minute before they been reaching 90% of distance to target. I could not figure why this happened, and cant revert both the projects (mine and minimal-example) to previous state. But neither less the behavior is persistent between projects and engine versions 4.1-4.3.) Second GIF is where I'm Using custom integrator forces and just add gravity to velocity. (Now rigid bodies actually reaches target) Custom Integrator version:
This is example from GDQuest. I've changed projectiles to rigid bodies 3d. And we can see that now they are falling slightly off, not reaching the target.
Steps to reproduce
Calculate velocity for projectile needed to reach target and apply it to RigidBody3D.
Minimal reproduction project (MRP)
Gravity_Bug_Report.zip