hubs icon indicating copy to clipboard operation
hubs copied to clipboard

BG - Kinematic bodies are yielding to dynamic bodies

Open j-conrad opened this issue 1 year ago • 3 comments

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:

  1. Open the included .blend file.
  2. You can change the Mass of the object called 'Body.dynamic' for different results.
  3. Export the .glb and load it in Hubs.
  4. turn on /debug to see the bodies and their reactions.
  5. 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

j-conrad avatar Oct 05 '23 22:10 j-conrad

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?

Exairnous avatar Oct 07 '23 09:10 Exairnous

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.

j-conrad avatar Nov 08 '23 00:11 j-conrad

Ah, okay. Thank you for the explanation!

Exairnous avatar Nov 08 '23 02:11 Exairnous