0 votes

I'm trying to make a platformer that has a dash. This dash would go towards your mouse every time you left-click but I'm having trouble with it.
I don't have much (or any really) experience with Godot and Coding in general so something simple and janky would already be great.

Currently, I have something like this

dash_direction = get_global_mouse_position() - position
if Input.is_action_just_pressed("ui_mouse"):
    motion = dash_direction.normalized() * dash_speed

motion = move_and_slide(motion, Vector2.UP)

but the problem is that whenever I left click it does a weird L type motion and I don't understand why

in Engine by (33 points)

it does a weird L type motion and I don't understand why

Do you apply any gravity to your Character? What is the value of dash_speed? When is this code called? physics_process? process? _input? _unhandled_input?

I cannot reproduce your issue.

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 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.