I have a function called LookAtMouseCursor; when I bind it to Event Tick it runs perfectly once per frame, but when I trigger it using Set Timer by Function Name it fires far more frequently than expected, sometimes multiple times per frame — my goal is for the timer to operate at the same pace as Event Tick.
2025-05-11 11-40-36 (1080p).mkv (7.7 MB)
Hey @DevletSanatcisi!
Expand your Set Timer by Function Name
node and enable the Max Once Per Frame
property
@VisAgilis suggestion should solve your issue. But may I ask why not just use Event Tick at that point, instead of the Timer? Just curious.
I’m still a beginner, but from what I’ve read online and learned so far, it’s better to avoid using Event Tick unless absolutely necessary.
Many sources recommend using timers, custom events, or specific update triggers instead, because they are more controlled and only execute when needed. I’m trying to develop better habits early on by minimizing unnecessary per-frame calculations.
Thank you for the suggestion! I tried it, but unfortunately it didn’t work for my case.
Hey @DevletSanatcisi!
You’ll need to elaborate. Because while having the Max Once Per Frame
property of a Timer enabled, the output should be the same if you used Event Tick to execute the same logic. Given that the time interval of our looping timer is lower than world delta seconds of course, if not, then the logic bound to the timer would operate less frequently but that doesn’t seem to be the case since you mentioned your issue was that it’s in fact more frequent.
So get back to us with some screenshots and a video showcasing the issue! If you’re not able to share them on this platform, you can upload them to YouTube and share the link.
About this:
I think you might have misinterpreted that, or the tip was out of context. You can indeed optimize your program by not calling unnecessary stuff every tick, but lemme give some examples on what kind of things are counted as unnecessary.
For example, if a condition is already not expected to occur any given moment, then you wouldn’t handle the following logic in Tick. Another example, if you do need to check something every frame, but there’s a hierarchy going on, maybe a collision check would logically only be needed while the player character is airborne, then you’d first check if the player character’s moving on ground, and early exit if it is.
As you can see, these don’t mean that you should avoid Tick and only put stuff in there until “absolutely necessary”, you just be mindful of not having redundant and possibly expensive calls every tick.
Now when we apply this to your specfic case:
It sounds like you wanna rotate a top down character to face to the cursor. Event Tick is the best place to handle this logic. There’ll be no benefit in using a timer here, and no it won’t make your code more modular. If I were able to understand your intention correctly, it’d also be better for organization purposes and debugging process to have this inside Tick. Because we’d expect this logic to be called all the time, even if there’ll be occasional exceptions, so naturally we’d want to be able to see it under Tick when we wanna check our exec flow.
Not saying you’d encounter any issues when you wanna handle this using a timer tho, so if you really want to, like I said earlier you can share the related parts of your Event Graph and also a video showcasing the issue so we can ensure that we’re on the same page.
Hope these help!
Thank you very much for your help!
What you explained makes a lot of sense, and I’ll proceed with using Event Tick for this case.
Also, I had already uploaded the video in “.mkv” format above, but I’ll also attach a YouTube link to this message for convenience.
https://www.youtube.com/watch?v=QWRItgaspss
Replicated your blueprint code exactly, but couldn’t reproduce the issue
In your video the Max Once Per Frame
property isn’t enabled tho. I’d guess your world delta seconds is already 0.0166 since you inserted that value into the Time
pin of the node, but just to make sure could you confirm that you get the same output when you enable it?
Hmmm, I wonder if it’s actually related to your function. Because setting the character’s rotation according to the delta rotation more frequently shouldn’t make it rotate faster with the cursor. And it indeed doesn’t, also tested that just in case. I suspect your function is interfering with something else. In your video we can kinda see how you handle that “camera tilt”, but maybe it’s also present in other parts of your Event Graph. Very interesting
Movement is only processed once per frame (tick groups). Camera rotations can be updated whenever.
FPS fluctuates so you can get multiple timer executions if timer interval is lower than tick interval.
Printing delta seconds or tick count to log on each execution of timer event would go a long way toward troubleshooting.