FoxyOfJungle
Kazan Games
Hello,
I'm trying to acquire the vertical and horizontal speed of an instance in which is using a path, but apparently there is no way to do it...
I just did this:
CREATE EVENT:
STEP EVENT:
ALARM 0:
But the variables
I also tried to define the
I also used the same code above using alarms set to 1, 2 and 3, and it didn't work. I can't just get the horizontal and vertical speed of the instance.
I will be grateful if you can help me with anything.
Thanks!
I'm trying to acquire the vertical and horizontal speed of an instance in which is using a path, but apparently there is no way to do it...
I just did this:
CREATE EVENT:
GML:
my_path = -1;
alarm[0] = 2;
GML:
// hspeed and vspeed
hsp = x - xprevious;
vsp = y - yprevious;
GML:
path_start(my_path, 1, path_action_continue, false);
But the variables
hsp
and vsp
are always 0.I also tried to define the
xprevious
and yprevious
variables in the Begin Step event but it doesn't work either:
GML:
xprevious = x;
yprevious = y;
I will be grateful if you can help me with anything.
Thanks!
Last edited: