Hi everyone,
I’ve been struggling with a physics issue for the past two days, and I can’t seem to figure it out.
The setup is quite complex, so I prepared a minimal reproduction of the problem.
In short:
I have a prefab that acts like a lever using a ConfigurableJoint. This part works perfectly fine. The problem occurs when another physics object (let’s call it Dynamic) is “Welded” to the lever. Welding in this case means that Dynamic loses its Rigidbody and gets parented to the lever.
Before being welded, Dynamic is moved using another joint that connects it to an object called Kinematic. Kinematic has a Rigidbody with isKinematic = true and moves back and forth. When I perform the weld, I also update the connectedBody in the joint, switching it from Dynamic to the Lever.
The issue is that the lever placed in the scene (a prefab instance with no modifications) behaves differently from the spawned version of the exact same lever.
Has anyone encountered a similar issue or has any idea what might be causing this difference? Any help would be greatly appreciated! If this turns out to be a Unity bug, I can report it."
Showcase working good - https://www.youtube.com/watch?v=i3AnbqRWCDM
Showcase working bad - https://www.youtube.com/watch?v=gZv0pdEba0M
Minimal setup - GitHub - DamianHelizanowicz/PhysicsBug: Minimal setup for bug in Unity Physics.
Thanks in advance!