I have a 2D game with lines and sprites. Everything has a Polygon2D collider on it, and I am trying to detect when they collide so I can take action.
However no matter what I do, the OnTriggerEntered2D and OnCollisionEntered2D callbacks never get called, even when there clearly is an intersection. I have tried adding the callbacks to the GOs on both sides, with no luck.
Here is an image showing two objects with Polygon2D colliders clearly intersecting:
Link to full size: Imgur: The magic of the Internet
If you’re using collision, I think you need rigidbodies2d on both. If you are using trigger, I think the one that isn’t the trigger needs a rigidbody2d
It’s easy to make that mistake, I’ve done it. Visual Studio doesn’t pickup those functions in autocomplete, not sure if mono develop does… never used it.