When this imp character dies, I want its body parts to fall on the ground. So my idea was to iterate over some body parts, and add rigidbodies and colliders.
All the game objects are on the same layer, “Mob”, and in the Physics collision matrix, Mob cannot collide with Mob.
Any idea what could cause the parts to fly off into the distance whenever I add physics to them? Even if I put a high drag, then they still fly off insanely quick.
I played with the mass and drag values but I dont think they’re the root cause. Even with heavy mass they fly off super quick.
It feels like it happens when the body parts collide with the floor, but if I go to the scene view, and grab 1 body part and drag it over the terrain and drop it, then it works fine, it just collide properly.
It’s caused by your objects overlapping when you turn them into rigidbodies. Before turning them into a rigidbody you can try moving them out from the character’s center by 0.3 meters or so. Or create an array with the necessary clear positions for the body parts.
Or just add even more drag (including angular drag) to slow them down. Although a very high drag setting will cause them to seemingly float down to the ground.
Also, looking at this still frame from the video, it looks like the different part didnt push each other off, so might not be the overlap that’s an issue?
There was a similar problem. The Animator on the gameObject played the animation of the character’s parts, and when these parts became dynamic, everything broke. If the object has an Animator component, it is better to disable it.