I’m unable to have the console successfully print “package picked up!” once the car drives over the square sprites (assigned with the Package tag), I double triple checked my work in unity and vscode and couldn’t see a difference between the lecture…any help here? (edited)
There’s no collider on the package (from what I can see in the screenshot)
1 Like
Hi ok.computers,
bixarrio is right. In Unity, collisions happen between colliders. Only collisions between Collider2Ds are able to trigger the OnCollisionEnter2D or OnTriggerEnter2D methods.
The ‘Square (2)’ game object does not have any Collider2D component attached, hence it cannot be part of a collision event.
If adding a BoxCollider2D component did not fix the issue for you, please rewatch the video at least one more time and compare your Hierarchy and the content of your Inspector to Rick’s.
See also:
- Forum User Guides : How to mark a topic as solved
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.