unity-game-enginetriggers2dcollider

I can't get my sprites to trigger a collider at all in Unity


I am trying to get one sprite(the player) to trigger a function when colliding with another object that is getting cloned and put into random places within the play field. I have my player collider set to being a regular collider with a rigidbody2D attached. The object to collect here is marked as a trigger, is kinematic, has the OnTriggerEnter function attached(which most other scripts have at this point just to see if it would work), and not a single thing has changed anything about how the game runs or works or anything it seems. What am I missing?


Solution

  • After reading a comment on the main post, I found the answer. I simply didn't know that Collider2D and OnTriggerEnter2D was a thing, and once fixing that, I was able to solve the issue!