Code shows both Collision and If statement

When I run the code, I notice that both my initial collider and my if statement are showing… His is not doing that so I am wondering what I have done wrong.


2022-06-25 (1)

Hi,

In each collision event, two colliders are involved. The trigger collider triggers the OnTrigger* method(s), and the non-trigger the OnCollision* method(s). If both methods get called, there are probably one non-trigger and one trigger collider involved in the collision. That’s not necessarily wrong.

Did this clear it up for you?


See also:

Thank you! I played with the collider element and rechecked everything… turns out I just stink at driving… with the package and customer isolated away from the other colliders it works just fine :woman_facepalming:

Collisions are not a problem per se. We have not implemented the actual game logic yet. The goal of this video was to log messages into our console during collision events. If OnTriggerEnter2D logs the correct messages into your console based on the tags, your program works as it is supposed to. :slight_smile:

If you notice that your driving skills break the game at some point after you completed it, you’ll have to rework your level and/or create additional rules covering the unwanted cases.

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

Privacy & Terms