• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML [Solved] Enemy AI Stop and Not Moving

H

HijklX10

Guest
i need help, i want to make an ai that will

1-move left and right, that will stop a moment before changing direction.
2-will stop moving when player is in x radius
3-move again after a few second pass and player is over x radius

i manage to get the first two, but my ai wont move after it has stop, could anyone help / give suggestion me with this?
i really appreciate the help and thank you.
 

TheouAegis

Member
When you want to change directions, stop and set a timer. If the player is too close, stop. Check if the timer is greater than 0 and count it down. Check if the timer is 0 AND if the player is out of range, then start moving again.
 
H

HijklX10

Guest
When you want to change directions, stop and set a timer. If the player is too close, stop. Check if the timer is greater than 0 and count it down. Check if the timer is 0 AND if the player is out of range, then start moving again.
thanks your help.
 
Top