0 votes

hi, i'm traying to make a movement in the air while my player is jumping, but a have some problems; when the player it's in the point 0 of Y qhuen it jump i stop the movement in Y so i can make a displacement in X while i'm pressing "uiright" or "uileft", i got this:

if (!is_on_floor() && movimiento_cebollin.y > 0 && Input.is_action_pressed("ui_right")):
    self.position.x += 100
    var air_displacement = true
    movimiento_cebollin.y = 0;

    if (air_displacement):
        #get_tree().set_pause(true);
        print("here it's has to fall")
        movimiento_cebollin.y -= cebollin_jump_speed; 

when 100 is added to self.position.x i want that the player inmediatly stop and fall, but it's keep falling in a vertical way, and also the movement look's like a teleport lol

in Engine by (22 points)

I think if you apply delta to movement, it will be smooth and... you have reset to 0 the Y movement when is greater tan 0... I don't understand why, that make you go down immediately.
If I'm on a mistake, please, somebody correct me.

Please log in or register to answer this question.

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.