Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity Ragdolls causing problems with mesh renderer

I've set up this enemy to turn into a ragdoll upon death, fly into the air a bit, and behave like a ragdoll. It is all working fine as far as i can tell.

Except i am encountering an issue where the enemy keeps popping in and out of existence, depending on the cameras rotation/position.

Here is what it looks like before the issue.

enter image description here

Then, from this position, if i rotate the camera slightly, it results in this:

enter image description here

The game is paused while this is happening so it is not related to movement in any way. I can also rotate the camera back and forth, and the model will continue to pop in and out of existence. No gameobject is being destroyed.

It it also nothing to do with the model clipping into / under the floor, as you can see in the pictures, i raised it up off the floor to test it, and it still happens while suspended in mid-air.

This issue only happens while the enemy is a ragdoll. If i turn off ragdoll deaths nothing like this ever happens.

Do you have any idea what could be causing something like this?

like image 930
niar88 Avatar asked Aug 12 '26 12:08

niar88


1 Answers

This is very easy to miss as it is only visible if you PAUSE the game to inspect the model/Skinned Mesh Renderer in Scene View so I'm putting it here for anyone struggling if that's the case.

enter image description here

Skinned Mesh Renderer has a Root Bone property which is many times set to the Root bone(or even None) and not the Hips bone of the character. In some imported models (and from the looks of it I guess this is a Synty model which has EXACTLY the issue I am going to describe) adding a ragdoll can result in the Renderer not following the model as a whole the way we want and this can lead in strange behaviors, one of whom can be disappearing completely from the game screen.

Assign the Hips Bone as the Mesh Renderer Root Bone, so it can follow the position and rotation of the model.

Note : If the hips bone has any rotation because of how it was created as a model, the result can be weird. To fix this create an empty gameObject inside the Root bone, then place it inside the Hips Bone and finally assign it as the Root Bone of the Renderer.

This way the Skinned Mesh Renderer will follow the character and you won't see it randomly disappear!

enter image description here

like image 59
Aris13 Avatar answered Aug 17 '26 23:08

Aris13



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!