- Home /
The question is answered, right answer was accepted
How to disable the collider of a character controller?
hi all, i need some help with the character contoller. I have a ghost that moves around the scene according to a set of waypoints. It has attached a character controller but, since it is a ghost, I want it to pass trough the objects. Then, the character controller acts like a collider and it makes it no possible. How can I disable the collisions of a character controller? I supose that it's easy, but I am very new at working with unity -sorry-. I have been searching trough the questions in the forum but I cannot find the solution.
thank you very much.
Is it possible to reverse the state of IgnoreLayerCollision (from true to false) during the gameplay?
Sorry for multiple posts
Call it again with false as the last parameter (and use comments ;) )
Answer by wall · Nov 27, 2010 at 01:15 PM
I have just found a solution: I have created a new layer containing my ghost (layer number 9) and i have made a starting function to ignore the collision with the default layer (number 0)
Physics.IgnoreLayerCollision(0,9, true);
Is there any better formula? Thanks!