Sorry 3run, that didn't work.


However, I found a solution that works very good grin :

I set an fakeposition every second to the actual position of the character.
If the character is suppose to move (established with c_move), but the actual position is the same or similar as the fake position, and if actual position stays as such for an second (or less), then the character is stuck!

Code:
var dist_ahead = 10;//speed to travel
var moving_distance = c_move(me,vector(dist_ahead,0,0),NULL,IGNORE_PASSABLE | GLIDE);//c_move code that establishes the moving distance



Code:
VECTOR fakepos;//this is the fake pos
var fakeposdist;//this will be the distance between the original position and the fake position
var poswait = 1;//Update the fake position every second
var calcstuck = 0;//we are not potentially stuck at the beginning
//////////
if(moving_distance>0)//character thinks it's moving
{
if(calcstuck >=1)//character is stuck!
{
my.move_speed = 0;//no movement
//preform I`m stuck action here
}
else{my.move_speed = moving_distance;}// movement is c_move speed
}
else{my.move_speed = 0;}//no movement
//
if(poswait>0){poswait -= time_step / 16;}//update fake position every second
else
{
poswait = 1;
vec_set(fakepos.x,my.x);	
}
//
fakeposdist = vec_dist(my.x,fakepos.x);//find out distance between the fake position and actual position
if(fakeposdist <= 50){calcstuck += time_step / 16;}//if the distance if the same or very similar to the actual position, then check how long
else{calcstuck = 0;}//nothing is stuck


Last edited by Blobfist; 04/18/18 15:05.