hubs
hubs copied to clipboard
BG - Kinematic bodies are yielding to dynamic bodies
Description
If a physics body is set to be Kinematic
, dynamic physics objects are affecting it, especially when they are heavier than the kinematic body.
Kinematic bodies are typically used for animated objects, being dependent on the animation to move them or otherwise keep them in place. In other words, a kinematic body should always be unyielding to dynamic objects, only exerting force but not receiving it.
The magenta body is set to be kinematic. The heavier the dynamic cube is, the more it pushes the kinematic body--even to the point where it will push hard enough to slip past it.
Mass at 5kg
:
https://gyazo.com/361a386f2d2abea78f761cec178b741f
Mass at 50kg
:
https://gyazo.com/0ed6a0b154423fecf3e3dd8ca8cb5e20
To Reproduce Steps to reproduce the behavior:
- Open the included
.blend
file. - You can change the
Mass
of the object called 'Body.dynamic' for different results. - Export the .glb and load it in Hubs.
- turn on
/debug
to see the bodies and their reactions. - The magenta kinematic body should be unyielding but instead it moves.
Expected behavior The magenta kinematic body should be unyielding but instead it moves.
Hardware
- Device: Desktop
- OS: Windows
- Browser: Chrome
Additional context
Attempting to change the Mass
in behavior graph doesn't seem to work as expected so be sure to change the mass manually before export.
KinematicBody_Bug.zip
The videos you show definitely seem buggy, but aren't there cases where you might want physics to override animation, e.g. you push on something motorized and your force overrides the motor?
Yes, but in that case, you would not use an animated body. You would drive it with physics as well (plus a motor force). Animated bodies are always unyielding. Essentially, just physics colliders parented to the animated object.
Ah, okay. Thank you for the explanation!