Hi, relatively new to UE4 here. I’m running an experiment to do some delay testing, and I would like to run a test where I just switch this bool (TestStarted) to True, run for TestDuration seconds, then switch the bool to False. This is what the blueprint looks like:
For some reason, the test will run (triggered by TestStarted being True) but won’t switch to off when the time elapsed is equal to TestDuration. I know the blueprint is a little janky, definitely room for improvement.
Can anyone see the issue here? Any advice would be so much appreciated!
Because Set Timer is not a delay. The branch runs only once when you set the timer, and at that moment it’s false. It never runs again.
You need to run all the timer logic by the event that connects to the red square Event pin.
Plus, the negative value in the initial start delay will cause the timer to tick instantly after it’s set, and since it’s not looping, the TestDuration value doesn’t matter. The timer will tick once instantly and that’s it. To use the TestDuration value, leave the initial start delay as 0.
Unfortunately the behavior is still not correct. When I start the test, there is a delay as long as the TestDuration before the actual test begins. This is why I had the initial delay set to -1 * TestDuration. Furthermore, the test just doesn’t stop although the control logic is set up outside of the timer.
If you have any more advice I’d really appreciate. Thanks!
That works perfectly, and now I think I actually understand how these darn timers work. Thank you so much!! You have certainly saved me before my meeting later.