• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

cant get off ladder

S

soggycereal

Guest
hi! so I put in code to make it possible for my character to go on a ladder and go up and down, but when I get on it, I can go as high as I want even though the character isnt touching the ladder object anymore. also, i cant move left or right on the ladder, or even jump off of the ladder, so the moment i touch the ladder im stuck there forever..

heres my code:

Code:
//ladders?

if (key_up || key_down)
{
if place_meeting(x,y,obj_ladder) ladder = true
}

if (obj_ladder)
{
x = (instance_nearest (x,y,obj_ladder).x)
vsp = 0
grav = 0
if (key_up) vsp = -2
if (key_down) vsp = 2
if !place_meeting(x,y,obj_ladder) ladder = false
if (key_jump) ladder = false
}

else {
ladder = false
grav = 0.5
}
sorry if its a simple error, i just dont know how to fix it :/
thanks!
 
Top