- Home /
Question by
sdgd · Dec 18, 2013 at 12:32 PM ·
c#wallsthroughcharacter.move
how to make CharacterCollider ignore LayerMask?
like if 1 player is wearing wall breacher he could pass through certain walls while others cannot follow him.
how to make so:
CharacterController controller = transform.GetComponent<CharacterController>();
controller.Move(Vector3.forward);
that he will breach the wall, ... ?
like iddclip does it, ...
Comment
Best Answer
Answer by GameVortex · Dec 18, 2013 at 01:34 PM
In the PhysicsManager (Edit - Project Settings - Physics) you can edit the Layer Collision Matrix to have collision be ignored between specified layers. Add two layers "PlayerIgnoreWall" and "Wall" and set it so the two layers do not collide with each other. Then apply the "Wall" layer to the walls in the editor and when in game you change the layer of the player to the "PlayerIgnoreWall" when picking up the powerup.
Now the player should be able to walk through the wall with normal movement.
Your answer
![](https://koobas.hobune.stream/wayback/20220613124423im_/https://answers.unity.com/themes/thub/images/avi.jpg)