Why everytime my Barry's head hit the ground

Why everytime my Barry’s head hit the ground, he is immediately transferred ALMOST back to the starting point and stops moving?

Hi,

Welcome to our community! :slight_smile:

When Barry’s head hits the ground, the player loses, and the level restarts. That was the idea we implemented in the videos, and that’s why this happens.

Did this answer your question?


See also:

Hi,

I got the idea of the game, but the question is I just added surface effector 2D (lecture 37), which means I haven’t added anything that can achieve the “LOSE” idea we are talking about. Also I watched the lecture several times and it seems that when Barry’s head hit the ground nothing happens.

Hi,

I think I know the answer. I didn’t used the assets provided, instead, I drawed my own Barry but the head and the board is not seperated. When I unclick “triggered” it went back to normal. However, could you please explain why I have to use two seperate assets to combine Barry? Thanks!

You do not have to have two separate objects. One sprite is perfectly fine unless you want to animate, for example, the head or arms only.

A game object does not need a SpriteRenderer. If Rick’s logic requires two game objects, you could create the second game object without the SpriteRenderer. For his idea, we need two Collider2D objects: one with “Is Trigger” enabled, the other one with “Is Trigger” disabled.

Generally, the sprites are just “decoration” in our games. The physics is defined by the Collider2D and Rigidbody2D components. The position of a SpriteRenderer in the Hierarchy is relevant only if you animate that game object with an Animator, Animation or Timeline (or something else).

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

Privacy & Terms