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

asked Mar 23 in Engine by Sininenblue (26 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 How to use this Q&A? before posting your first questions.