- Home /
Question by
AtomicMarine · Dec 31, 2011 at 02:45 PM ·
colliderobjectpassingpassthrough
Objects passing through each other?
How can I make it that one object can pass through certain objects but not other objects for example my character needs to pass through all the objects tagged as "trans" but other objects should not be able to pass through those objects?
Would I use tags to turn the collider on and off?
Comment
Best Answer
Answer by Peter G · Dec 31, 2011 at 02:55 PM
You have 2 solutions that are pretty easy.
Get a list of all your walls, then have them all ignore collisions between the wall and the player.
for( var wall in Walls ) { Physics.IgnoreCollision( wall, player); }
Use layers, and put the player and the walls in special layers. Then go to the physics manager and turn off collisions between those 2 layers.
I have put them all in the same layer, where in the physics manager do I turn off collisions??
Your answer
![](https://koobas.hobune.stream/wayback/20220613062538im_/https://answers.unity.com/themes/thub/images/avi.jpg)