0 votes

i have a dash on my player but he keeps moving forward due to its inertia. I want it so that his current position is starting position and when he moves like 200 x position away from start he stops.

in Engine by (384 points)

1 Answer

0 votes

Mind posting the code so I can help pin point the problem?

by (36 points)

if dashr.check()==1 and btnright.check()==2 and ORIENTATION=="right" and !dashtime.isactive():
move(250, 250,delta)
setappliedforce(Vector2(0,0))
setaxisvelocity(Vector2(0,20))
anim="Dash"
animplay=true
dash
timer()
control=false

elif dashl.check()==1 and btnleft.check()==2 and ORIENTATION=="left" and !dashtime.isactive():
move(-250, 250,delta)
setappliedforce(Vector2(0,0))
setaxisvelocity(Vector2(0,20))
anim="Dash"
animplay=true
dash
timer()
control=false

if feel like using the get_position function to get the position in the initial of the dash and then get the position during the dash if the add position is more than x then stop dashing

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.

Categories