Question by
$$anonymous$$ · Jan 06, 2016 at 12:00 AM ·
2d gamecollider2dedgepolygon collider 2dignorecollision
No errors console but Physics2D.IgnoreCollision does not work
Hi,
I have no errors on my console but it doesn't ignore collision... I don't understand why. There is my code:
public class gamer : MonoBehaviour
{
Rigidbody2D body;
public Transform bulletPrefab;
void Start ()
{
Transform bullet = Instantiate(bulletPrefab) as Transform;
Physics2D.IgnoreCollision(bullet.GetComponent<EdgeCollider2D>(), GetComponent<PolygonCollider2D>());
body = GetComponent<Rigidbody2D>();
}
}
Any help will be welcome :)))
Thanks
Comment
Your answer
Follow this Question
Related Questions
What can I do to fix it? (Polygon Collisor shape equals shape sprite) 0 Answers
Physics.IgnoreCollision between rigidebody2d+polygone collider 2d and edge collider 2d doesn't work? 1 Answer
Why is my Player slowing down between two Tilemap Colliders? 1 Answer