I have a simple enemy that moves left to right in a looping motion with a timeline. When the enemy overlaps the second projectile it will only stun them compared to the first projectile type damaging health. How would I go about adding the delay of 5 seconds to where the enemy still moves smoothly side to side but will stop in place when hit by the players “spray attack” then after 5 secs start moving again. Code is almost there I just believe something simple is missing that i’m not seeing. I am 3 months into learning coding with unreal so any help would be appreciated.
You’re having a bit of a ‘yikes’ moment there with the timeline. You have to realise that everything on the update pin is called EVERY FRAME. So your loop ( which by the way, does nothing with the bool ), is re-starting the timeline every frame
When the enemy gets the attack just trigger the stop pin on the timeline, then after 5 seconds, trigger the play pin.
This does nothing for me sadly. The enemy is supposed to be constantly moving left and right looping and only delay with a stop when overlapped with a projectile at a Key press.
After following a friend I’ve managed to update my code to this but it is still not working just right. I know it’s close…
Yes, correct, you need to incorporate this code with what you have ( minus the bool thing ). It wont do anything on it’s own of course…