My Triggers are not working Section 2: Ep. 23

Screenshot 2022-08-08 191552


As stated in the title my triggers aren’t working… help please?
What am I forgetting?

Hi,

One of the colliders involved in the collision events must be a trigger collider. Otherwise, the OnTrigger* method will not get called. Check the components in the Inspector. There is an option to make a collider a trigger collider.

Did this help? :slight_smile:


See also:

1 Like

Nope, I checked the “Is Trigger” and nothing has changed.
Does the inspector operations order matter?

Your Delivery script is attached to the Package game object. In your code, your OnTriggerEnter2D method checks if the other tag is “Package”. Assuming your car collides with the package, the car is the other game object in this collision event. Does the car have got the “Package” or “Customer” tag assigned? If not, the if-blocks will not get executed.

2 Likes

Thank you @Nina That worked!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms