Skinned Mesh disappears when too close

I have this character (from Mixamo), and esp on Mac and Web builds, he disappears when too close to the camera (PC much better). And by too close, I mean like 2 meters. And by Skinned Mesh I mean that all other rendered objects are just fine even very close. I attached a sphere to the character, which I can see just fine at any distance, even when the character mesh is invisible. I already set the near clipping on the camera to be pretty small. I don’t see any special clipping settings for skinned meshes. Any ideas?

From Warwick Allison’s hint, I looked into this bounding stuff, and found if I turn on ‘Update When Offscreen’, run, it fixes it. I can even turn that off again and it’s better. My character’s eyeballs (which I did not add, came with the model) then disappeared, but I was able to pull the same trick by turning on ‘Update When Offscreen’ for both of them too.

I have this very same problem - Unfortunately, due to performance reasons, I am not able to use the “Update when Offscreen” option, since we’re using this for our game’s NPC’s, which tend to get pretty heavy.

The option we’re looking into right now is to manually set the bounding box at runtime, but on that front, we haven’t yet figured out how - the bounding box would need to encompass the maximum extents of the mesh, including all possible animations that would be used for it. Is there a way to somehow sample each animation frame in an FBX file, and in that way get the maximum extents values for that file?

I’m continuing my search beyond this thread, so if and when I find a solution, I will make sure to update my post here :slight_smile:

UPDATE:

I have managed to fix this issue; the following thread provides the answer:

http://forum.unity3d.com/threads/44704-Fix-for-animation-bug

As you can see, this problem is most likely caused by Unity incorrectly setting the root of the file, by creating a root of its own. At least, for me, the issue was solved by inserting an empty, unlinked dummy in my fbx file, which forced Unity to set the Pivot of the FBX file to that dummy, for some reason.

I hope this helps someone :slight_smile:

The problem may be the Bounds of the Skinned Mesh Renderer. The bounds are supposed to be a cubic area surrounding the mesh. Try using the Edit Bounds button on the Inspector, with the disappearing object selected.

For Anyone who’s facing this issue.
U need to set the rootbone position of the attached object to the position of the Main SkinnedMeshrenderer rootbone position

Example:

O1 = Main.GetComponent<SkinnedMeshRenderer>();
O2 = Attached.GetComponent<SkinnedMeshRenderer>();
O2.rootBone.transform.position = O1.rootBone.transform.position;