Reputation: 325
I'm using the CharacterController.Move
function to move the player around the scene. I want the player to be able to pass through some objects under certain conditions. Is there a way to force the Move
function to ignore collisions with other game objects when certain conditions are met in the script?
Upvotes: 1
Views: 1143
Reputation: 395
Physics.IgnoreCollision(SomeObject.collider, collider);
// collider is a CharacterController
Or by using layers:
Physics.IgnoreLayerCollision(layer1, layer2);
Upvotes: 2