Topic was automatically imported from the old Question2Answer platform.
Asked By
Newby
Old Version
Published before Godot 3 was released.
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.
Mind posting the code so I can help pin point the problem?
if dash_r.check()==1 and btn_right.check()==2 and ORIENTATION==“right” and !dash_time.is_active():
move(250, 250,delta)
set_applied_force(Vector2(0,0))
set_axis_velocity(Vector2(0,20))
anim=“Dash”
anim_play=true
dash_timer()
control=false
elif dash_l.check()==1 and btn_left.check()==2 and ORIENTATION==“left” and !dash_time.is_active():
move(-250, 250,delta)
set_applied_force(Vector2(0,0))
set_axis_velocity(Vector2(0,20))
anim=“Dash”
anim_play=true
dash_timer()
control=false
Newby | 2017-12-02 07:16
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