- Home /
Part of mesh disappears on certain rotation angles in first person.
Hi. I created two cameras at the same position; Camera B is son of Camera A.
Camera B has a culling mask set to Weapon Layer only, meanwhiele Camera A has a culling mask which include all except weapons(this metod to avoid meshes compenetrations with first person object and walls).
I set the Depth etcetera, etcetera. The game shows the wapon, but the fbx is divided in weapon mesh and arms mesh.
So that is what happens. I don't know why but the hands mesh disappear/flicker at certains rotation angles, but that doesn't happen to the shotgun.
Here's a pic of inspector. Some help?
I had a similar problem when I was procedurally creating meshes. When the mesh was nearly out of view it would suddenly disappear (rather than waiting until it was truly out of view). I think what fixed it for me was calling $$anonymous$$esh.RecalculateNormals
on the mesh. I think $$anonymous$$esh.RecalculateNormals
must also call $$anonymous$$esh.RecalculateBounds
because most likely my bounds were misaligned and/or smaller than the object causing the camera to cull it early.
So, maybe try calling $$anonymous$$esh.RecalculateBounds
in the void Start()
of an empty attached $$anonymous$$onoBehaviour on the problem mesh's GameObject?
Hi.
How can I use $$anonymous$$esh.RecalculateBounds in Start? I tried to put it inside Start's {} but Visual Studio doen't allow it.
Answer by William4458 · May 29, 2017 at 06:31 AM
@Painboy There is a problem with unity's rendering system when setting the near clipping panels to low in which everything that is being rendered on that camera will be flickering when turning the camera. There isn't really a way to fix this other than playing around with the near clipping panel's values a bit and maybe moving the weapon and arms a bit further from the camera. I had the same problem and that's what kind of fixed it. I hope unity will fix this "bug" one day. Hope this helped and if it's the answer you're looking for please just take a moment and set it as "best answer" (I'm collecting karma points ;-)
Answer by Ragatto · May 27, 2017 at 11:33 PM
SOLVED!
The guilty was inside the hand's mesh in scene hierarchy. See this:
Root bone was not set as root_jnt(the first joint of the hands skeletal mesh) I just set as ROOT BONE root_jnt, so now every child of root_jnt are visible.