Jump disabled while touching ladder but also touching ground

I noticed that after implementing the ladder in lecture 16_TV_UY2 the character won’t jump if it is touching the ladder.

I’m pretty sure this could be fixed by changing the If-statement to include that a player is allowed to jump while touching a ladder or ground but I was wondering what causes this?

The boolean IsTouchingGround is true eventhough the player is also touching the ladder while standing underneath it.

I haven’t bothered to thoroughly debug this yet but I was wondering if anyone knew what the problem was and if there’s a simple solution.

Hi Solitar86,

Depending on the player’s position, the player could be touching multiple layers. Is there a reason why you think that he should touch only one layer? A screenshot might help me understand your idea.

You could also take a look at tender82’s solution:

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

Privacy & Terms