0 votes

Hi, I am making a platformer in godot, mainly inspired by celeste. I have got all the main mechanics working well but have one problem. In the game you can dash, if you want you can dash forward and can dash upward. I want my character to dash upward when you press the dash key while holding the jump key. I have tried some ways to get this working but none of them seems to work well. Does anyone have a working solution for this?

Godot version 3.4
in Engine by (73 points)

1 Answer

0 votes
Best answer

If you're using input actions, this should work:

func _input(event):
    if event.is_action_pressed("jump") and event.is_action_pressed("dash"):
        print("Jump and dash")

If you need to check outside of _input():

func _process(delta):
    if Input.is_action_pressed("jump") and Input.is_action_pressed("dash"):
        print("Jump and dash")
by (12,835 points)
selected by
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 Frequently asked questions and 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 [email protected] with your username.