So, to preface this post. I am very new to blueprint and working with Unreal Engine 4. I am 17 and I aim to be a professional game developer. Anyway…
I am trying to replicate the doors from the Hitman games, where after you open the door, it closes automatically after around five seconds. I have it working for the most part, but there is an issue when you open the door, then close it before the delay timer runs out. The door snaps back into the open position, and plays out its animation. Check out this video I whipped up very quickly:
If you have played any of the Hitman games, you should know what I am trying to achieve. So is there a way to fix this with what I currently have, or should I scrap the blueprint and redo it? Thanks.
The thing about delays is that it you try to revert something after a certain amount of time, and try to do something else before it is finished, it will try to do both things at once. You will need to add another branch after the timer to see if another animation is active. Basically have a bool before the timeline saying that there is an animation active. On finished, make it false. After the delay, check to see if it is still false.
I added “Idle?” as a Boolean, and set it so if the door is open, Idle? = true. If Idle? = false, then it will activate an event tick, preventing the delay timer from running out. Thanks guys.