The Impossible Squish
The Impossible Squish

Reputation: 325

In Unity can I allow the CharacterController.Move function to ignore collisions?

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

Answers (1)

RelativeLayouter
RelativeLayouter

Reputation: 395

Physics.IgnoreCollision(SomeObject.collider, collider); 
// collider is a CharacterController

Or by using layers:

Physics.IgnoreLayerCollision(layer1, layer2);

Upvotes: 2

Related Questions