OnCollisionEnter works, but IgnoreCollision does not
Firstly, RB isKinematic is enabled, and the Project Settings reflect the Kinematic/Kinematic collision support.
void OnCollisionEnter(Collision collision)
{
Collider collider = GetComponent<CapsuleCollider>();
if (collision.gameObject.tag == "Slave")
{
Debug.Log(collision.transform.name);
Debug.Log(collider);
Physics.IgnoreCollision(collision.collider, collider);
}
}
Both objects are instantiated, both Debug.Log()'s print correctly, but the IgnoreCollision does not prevent the objects from colliding.
Any help would be appreciated :)
Comment
try doing
Physics.IgnoreCollision(collision.gameObject.GetComponent<Collider>(), collider, true);
Your answer
Follow this Question
Related Questions
I need the functionality of both OnTriggerEnter and OnCollisionEnter in unity 1 Answer
How to make gridbased movement while also using collision? 0 Answers
Is there a way to limit animation on collision? 1 Answer
Why Does Bounciness Affects Rigidbody Velocity? (SOLVED) 0 Answers
Why/How 2d tower of blocks collapse? 0 Answers