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?
CodePudding user response:
Physics.IgnoreCollision(SomeObject.collider, collider);
// collider is a CharacterController
Or by using layers:
Physics.IgnoreLayerCollision(layer1, layer2);