Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity ignore collision between two objects

private void OnCollisionEnter(Collision collision)
{
	if (collision.gameObject.layer == layerToIgnore)
    	Physics.IgnoreCollision(collision.gameObject.GetComponent<Collider>(), GetComponent<Collider>());
}
 
PREVIOUS NEXT
Tagged: #unity #ignore #collision #objects
ADD COMMENT
Topic
Name
5+7 =