Creating a very simple gun turret

I am attempting to create a very simple gun turret enemy on the map through events only. It would work by checking if the player's x matches its own, then playing an animation and waiting before checking again. If the player's x matches the turret's x on the second check, it plays a second animation and damages the player repeatedly until the player moves to an unmatching x coordinate.

Unfortunately, testing has shown that the turret plays the first animation but fails to proceed to the second coordinate check even if the player is standing still, looping the first animation repeatedly instead.

The event is in the spoiler below. It is likely that I am overlooking something exceptionally obvious to this forum, and so I ask for your assistance.

Spoiler: Turret Event
RPGMV_ziE5Gab3pM.png
I am attempting to create a very simple gun turret enemy on the map through events only. It would work by checking if the player's x matches its own, then playing an animation and waiting before checking again. If the player's x matches the turret's x on the second check, it plays a second animation and damages the player repeatedly until the player moves to an unmatching x coordinate.

Unfortunately, testing has shown that the turret plays the first animation but fails to proceed to the second coordinate check even if the player is standing still, looping the first animation repeatedly instead.

The event is in the spoiler below. It is likely that I am overlooking something exceptionally obvious to this forum, and so I ask for your assistance.

Spoiler: Turret Event
Hmmm maybe try adding another WAIT at the END of the parallel process event...

also you said the second animation did not execute... does the hp damage still happen though? just to make sure you enter the second if condition...

hope this help...
One problem here is that you're checking the X coordinates again after that 16-frame wait, but you're *not setting the variables to that data again* so it's just taking the values it had the first time round anyway and this condition is always going to end up being true.
One problem here is that you're checking the X coordinates again after that 16-frame wait, but you're *not setting the variables to that data again* so it's just taking the values it had the first time round anyway and this condition is always going to end up being true.
Hidden in plain sight just as suspected. Thanks, this worked perfectly.

This is officially solved.
Closing this.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-very-simple-gun-turret.136338/