Hi!
I use the move_towards_point function, but I have a weird issue.
If I use it in the STEP event, it’s works perfectly, but in ALARM it” “vibrating” on the endpoint.
// with STEP (it works)
//Step:
if (global.ACTION = 1)
{
DISTANCE = point_distance(x, y, 32, 160);
move_towards_point(32, 160, min(5, DISTANCE));
}
////////////////////////////////////////////////////////////////////////////////////////
// with ALARM (it doesn’t works)
//Step:
if (global.ACTION = 1)
{
if (alarm[0] == -1)
{
alarm[0] = 30;
}
}
// alarm[0]:
DISTANCE = point_distance(x, y, 32, 160);
move_towards_point(32, 160, min(5, DISTANCE));
I use the move_towards_point function, but I have a weird issue.
If I use it in the STEP event, it’s works perfectly, but in ALARM it” “vibrating” on the endpoint.
// with STEP (it works)
//Step:
if (global.ACTION = 1)
{
DISTANCE = point_distance(x, y, 32, 160);
move_towards_point(32, 160, min(5, DISTANCE));
}
////////////////////////////////////////////////////////////////////////////////////////
// with ALARM (it doesn’t works)
//Step:
if (global.ACTION = 1)
{
if (alarm[0] == -1)
{
alarm[0] = 30;
}
}
// alarm[0]:
DISTANCE = point_distance(x, y, 32, 160);
move_towards_point(32, 160, min(5, DISTANCE));