0 votes

I am trying to make a game where you climb a ladder up and down.
so far I am using an area 2d and attaching a script to call a function on the player to press a button to ascend the ladder, but the player doesn't ascend the ladder

Here is the function code:

func climb():
motion.y = 0

 print ('climb')

 if Input.is_action_pressed('ui_up'):
    motion.y -= speed
 elif Input.is_action_pressed('ui_down'):
      motion.y += speed
 pass

Any suggestions?

in Engine by (16 points)

1 Answer

0 votes

Does it print ('climb')?
Is the speed set if you print that variable to?
Do you apply your variable motion to the nodes position somewhere?

by (911 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.