Hello all,
I'm creating a missile via script attached to the first person controller. The only problem is that my missile collides with the character controller's collider before it moves anywhere. I've tried to use Physics.ignoreCollision() but it doesn't seem to work with the character controller.
function FireRocket () {
var rocketClone : Rigidbody Instantiate(rocket, transform.position + Vector3 (0, 3, 0), transform.rotation);
Physics.IgnoreCollision(rocketClone.collider, transform.root.GetComponent(CharacterController).collider);
...
I've used some printouts and determined that the missile is indeed colliding with the "CharacterController"
Physics.IgnoreCollision(rocketClone.collider, transform.root.collider);
doesn't work either.
Any ideas? I could use layers, but I'd rather do it without them.
EDIT: I've done more testing, and my IgnoreCollision call points to the exact same object/collider that is colliding with my missile. I really don't understand why this isn't working.
Physics.IgnoreCollision(rocketClone.collider, transform.GetComponent(CharacterController).collider);
^^is the call that I'm using now, just to avoid any confusion. (they all should point to the same collider anyway)
Cheers,
Unislash