- Home /
1st person arms still clipping with near plane 0.01
Hello. I have a problem with my first person arms. They are still clipping with camera (I can see the "insides") even though I have set the near clipping plane of camera to 0.01. Do you know how to fix the issue? Maybe it has something to do with model? I'm using blender.
Answer by aldonaletto · Sep 15, 2013 at 09:05 PM
Don't set the near clipping plane distance below the default 0.3! Low near plane values result in quite noticeable Z-fighting: overlapping objects beyond some distance flick their contours crazily when you move or rotate the camera. Anyway, this should solve your problem (despite creating another one): if it isn't working, something else is setting the near plane to the original value
A possible solution is to modify the camera position so that the near plane doesn't touch any part of the body - it's easy to see the near plane in the Scene view. Another possibility is the two camera approach: place the body in some specific layer and disable this layer in the main camera; add a second camera with higher depth and enables only this layer - you can use a low near plane distance in the second camera, since it only renders the player.
I have the two cameras approach already. So it isn't the problem with near plane being set too close.
So, you're already using the 2-cameras approach - this should solve your problem! Since it isn't, something else is wrong: the closer near plane is being set in the wrong camera, or something in the code is restoring the original 2nd camera near plane, or the main camera is rendering the player too and hasn't a lower depth etc.
Let's check the basics: create a new layer (let's call it PlayerBody) and move the weapons and the player body to it; create a new camera (remove its AudioListener) and set the fields Depth = 1, Clear Flags = Depth Only, Culling $$anonymous$$ask = PlayerBody, Near = 0.01; child this camera to the $$anonymous$$ain Camera and reset its position/rotation. In the $$anonymous$$ain Camera, the only change is the Culling $$anonymous$$ask, where everything but PlayerBody must be marked. Check these settings carefully - they always work fine, thus you must have missed something.
Thank you for this answer, I know its three years later, but this answer really helped me understand why I was having clipping issues. Thanks again and it helped me to eli$$anonymous$$ate the players flashlight from clipping against the walls.
Thanks for your answer, but I double checked everything and it is set exactly like you mentioned. Could it be some kind of problem with the 3d model?
No, this is clearly caused by near plane clipping. Try to eli$$anonymous$$ate suspects one by one. For instance: while the game is running, disable the second camera in the Editor - the player body should disappear; if it doesn't, the depths are wrong and the main camera is covering the second one, or the layers are incorrectly set and the player is being rendered by the main camera. If the player disappears, then the second camera's near plane must be the culprit. Pay attention to public variables: the Editor keeps the last values set, even if we change them in the script - if you're setting the near plane to the value defined in a public variable, it may be keeping some old and incorrect value.
Answer by stuart_jackson1992 · Jul 15, 2014 at 11:40 AM
Eric 5h5 answers your issue here if this helps
http://forum.unity3d.com/threads/can-i-disable-culling.43916/
Worked for the similar situation I was having!