Why the timer does not work?

I want to make a countdown timer, but it is not being used during game execution. Breakpoint debugging finds that it has no calling event and the string is not printed on the screen. I don’t know how to modify it. If you know, please advise

It doesn’t work because it’s running for one second, after which you stop it from working (by clearing it) as soon as it reaches <= 0.

See the “Set Timer by Event” node? Change that “1.0” to something like 100. Or do you want it to check every second?

If the Print String doesn’t show “9”, it means you didn’t call “TimerCount” from Event BeginPlay or something like that. Also, why subtract the remaining time from 10? It will always give you 9.

I want to print a string that counts down 10 seconds every second, but calling “TimerCount” with other events doesn’t print anything, I don’t know why.

i wouldnt even bother with the time remaining. why not just use a variable and decrement it every second. seems like its much easier to implement.

Good idea! Initially I tried to use “delay” in the loop, but it didn’t work. It now appears that recursion is useful. Can “Set Timer By Event” be called only in “BeginPlay”?

you can call the script whenever you like you just need to use a different event to start it. for example you could replace the begin play with a keyboard input such as the number 1 key, then everytime you pressed the one key the timer would start counting down. its pretty much how the second picture is done, the actual countdown timer in the second picture is initiated by calling the print timer event. that event is also how it loops.

OK. This problem has been solved. Thank you very much.