Character not climbing

my character is not climbing the ladder

Hi,

Have you already rewatched the video at least one more time? Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Are there any error messages in your console? Have you already tried to add Debug.Logs to your code to see what is going on during runtime?

Hopefully, this helped you find the problem. If not, please share more information on what you did and have in Unity. :slight_smile:


See also:

You might have selected the wrong ‘Is Trigger’. You want to select the one in the Tilemap Collider 2D. There’s another one in the Composite Collider 2D, which is a bit deceiving, so you might have checked that one by mistake instead.
Screenshot 2021-11-12 144847

No, I believe that’s not the case here. I have mine enabled and it works just fine.

image

Also, what Rick doesn’t mention (maybe he will in latter lessons) is that he never checked the “Used By Composite” box. Otherwise, why add it in the first place, if we won’t use it, right? :slight_smile:

I myself had this problem as @isha_89, and the answer was simple. In my case, that is.

I rushed with typing my code and made a mistake. So I had this:

Vector2 climbVelocity = new Vector2(playerRb2d.velocity.x, playerRb2d.velocity.y  * climbSpeed);

…instead of this:

Vector2 climbVelocity = new Vector2(playerRb2d.velocity.x, moveInput.y  * climbSpeed);

Hope that helps anyone!

1 Like

It works for you because you thought of ticking the “used by composite box” if not, you could check the “Is Trigger” box on the Composite Collider 2D and nothing would happen.
In that particular case, checing the Is Trigger on the Tilemap Collider 2D would solve the issue.

But of course here the best thing to do is to tick the boxes as on your picture!

1 Like

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

Privacy & Terms