- Home /
physics ignore terrain collision on trigger
Hello. I tried to use Physics.IgnoreLayerCollision to get the player through the terrain. It works, but every other object falls down through the terrain too. I am trying to get the player through a cave entrance that cuts through the terrain. Other npcs follow the player, and I have other things roaming around. I need the tag along people have to wait until they themselves touch the entrance collider, not when the player does and for everything else to stay out ignoring collision alltogether. Any tips? Thank you
Answer by D4rt · Jul 07, 2013 at 04:26 AM
I guess the logical answer would be that you have all the objects in the same layer as the player. When you call Physics.IgnoreLayerCollision it ignores the collisions for all the objects. You can either put the player on it's own layer or use Physics.IgnoreCollision which is applied only to two objects.
http://docs.unity3d.com/Documentation/ScriptReference/Physics.IgnoreCollision.html
Thank you. What I did was put a trigger on the tag along npcs to switch their layer when they touched the entrance.
Your answer
![](https://koobas.hobune.stream/wayback/20220613105618im_/https://answers.unity.com/themes/thub/images/avi.jpg)