Snow Boarder | Finishline Error

I am currently on lecture #36 of the 2d Unity course and the Finish Line and Crash Detection scripts don’t seem to be working. Whenever the player goes through the finish line or bumps their head on the snow, the console just has no response. Can anybody help?

Finish Line Script
image

Crash Detection Script
image

Player

Finish Line

Level Sprite Shape

The player (Barry) doesn’t appear to have a collider attached to them. For collisions to be detected between two objects, both objects need to have a collider and at least one of them needs a Rigidbody.

I see. There is another thing that I forgot to mention is that the player parent has 2 children game objects, one which is the bottom of the snowboarder, and the other which is the top of the snowboarder. Each one has their own collision. So does this mean that I have to add the script to both of the children game objects?

image

I actually found the solution. The solution was that I had to add the player tag to both the children game objects for the scripts to “know” if the collision was happening with the player. Thanks for your feedback!

I’m glad you got it sorted out!

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

Privacy & Terms