- Home /
Why do objects pass through a mesh/
I have a character with arms made from a cube object that use box colliders and low poly mountains that have a mesh collider. But when the arms run into the mountains, they go straight through instead of being deflected. The mountain has a mesh collider, not convex, and each arm has a box collider and a rigidbody, no gravity and non kinematic. Can someone please explain why the box colliders dont collide with the mesh collider?
I'm a bit lazy, so I used the built in fps controller and added the arms as a a child of the character.
Answer by PolyvivalStudios · Jul 28, 2018 at 03:32 PM
Do you mean that the arms go through the mountain? Then it's a clipping problem. You could fix it like this:
Make A Hands Layer and set it to the hands, then you should make another camera that only renders the "Hands" Layer and make it a child of your main camera. Make sure to set the new camera to "Depth only" and make the depth 2 and set your original camera's depth to 1 and set it to not render the "Hands" layer.
if you have any questions or you didn't understand my answer, just ask! C: @pearsonfrank001
@Unityfyer can you explain why this works? It worked fine for my project.
i know that I am late, but I will answer anyways. It is quite simple. It makes the "Hands" layer render on top of everything making it not overlap with other meshes. @pearsonfrank001
Answer by KarlFa · Jul 27, 2018 at 08:26 PM
Check physics settings to make sure mountain and box's layers can collide with each-other.