T
Triela1
Guest
Hello,
New to GMS, first game and currently working on the movement for a platformer and I'm stuck on one particular movement.
When on the ground the player is in the "grounded" state, by tapping left or right on the analogue stick the player enters the "dash" state.
When in the "dash" state I wish for the player to move a set distance from where the dash started but in order to do that I have to find and store the x position when first entering the dash state.
I have tried everything I could think of, exhausted google and these forums but the closest I could get is to endlessly move in the desired direction with
move_towards_point((x + dash_distance), y, dash_spd);
Any attempt to store the x position resulted in x being 0 and the player moving to x = 0 at dash_spd then vibrating.
Any help is greatly appreciated.
Thank you
TL;DR : Need to store players x position to move a set distance from that position.
New to GMS, first game and currently working on the movement for a platformer and I'm stuck on one particular movement.
When on the ground the player is in the "grounded" state, by tapping left or right on the analogue stick the player enters the "dash" state.
When in the "dash" state I wish for the player to move a set distance from where the dash started but in order to do that I have to find and store the x position when first entering the dash state.
I have tried everything I could think of, exhausted google and these forums but the closest I could get is to endlessly move in the desired direction with
move_towards_point((x + dash_distance), y, dash_spd);
Any attempt to store the x position resulted in x being 0 and the player moving to x = 0 at dash_spd then vibrating.
Any help is greatly appreciated.
Thank you
TL;DR : Need to store players x position to move a set distance from that position.