so what i did was when the variable for the object is true the effect turns on, but then I want it to wait for x amount of seconds, then I disable the effect and change the animation, however it doesn’t work, the animation changes but the effect is still on
(sorry that I removed actions I mentioned as it wasn’t working)
That part isn’t the issue, they want to have a delay for the change
@ricardosalazaar I’m not exactly sure where you want the delay. Are you saying that you want the effect to turn on when the object gets close, but then turn off after a few seconds even if the object is still closer than 200px?
If that’s the case, then you would need either an object timer, or a variable that counts down. The Wait action will probably not work too well because if something else happens in between, the Wait still goes on. Imagine this scenario:
Object gets close, enable effect and wait 5 seconds before disabling.
Object moves away, disable effect.
Object moves close again before the original 5 seconds has passed.
Now what will happen is the effect will suddenly disable at 5 seconds from the original trigger. The Wait instruction branches off the game logic and cannot be interrupted in any way (other than making a check at the end of it). So for this reason you would want a timer:
Object gets close, enable effect and start timer.
Object moves away, disable effect.
Object moves close again, enable effect and reset timer.
This way, the count to 5 seconds restarts when the object gets close again, avoiding weird interruptions.
The same type of thing would work if you just want a little delay after the object moves farther away. In this case, you would want to pause or delete the timer when the object gets closer again.