I have a float number being updated dynamically by real world time, updating every ms.
I’ve clamped that data to how I need it. And when I debug the output of my math to a print string I can see the value is updating smoothly every ms in the editor window. Perfect.
However that exact same value/result plugged into the “set actor rotation” node causes the rotation to update only every ~30 frames. So on one hand I can see the value is updating as its meant to every ms (in the print string), but rotation is not updating every ms despite using the exact same float data.
It’s not a performance issue - this is a very small prototype and runs at ~100fps in the editor.
And it’s not a decimal issue because there are equal number of decimal places on both data streams. And when I run a simple “rotating movement” it operates smoothly as you’d expect with as many decimal places.
I’ve even tried routing my set up through a timeline instead of directly controlling the set rotation node with my float however I get the exact same result.
I feel like it’s going to be something incredibly simple but I’ve spent the better part of the last 2 days trying to fix this but I can’t quite seem to get it. And the resources out there are more about interpolating between two rotations rather than a constant MS update.
Could you explain how this is supposed to work? The timekeeper actor produces what, milliseconds? Using which method? Or frames? If so, how?
And then you pull that data during Tick update using a combination of nodes the engine specifically tells you not to pair (read the tooltip of that Get node). While this may work, it’s not something I’d rely on.
a constant MS update
How about we made the timerkeeper dispatch ms time via a timer to all listening actors?
I’ll prafece by saying I’ve since been troubleshooting with the “time keeper” math moved from the other actor to inside this main blueprint. So I don’t call the variable from another BP any more and I’m still having the same issue.
The time keeper (or “the math”) gets the current real world time to the current millisecond of the year. I’ve since updated the logic since my post and now it is expressed by minutes through a float (ie, it is currently 230149.4121 minutes), rather than total ms as in my screenshot in the OP.
Seconds and milliseconds are appropriately range clamped to accommodate the difference between base-60 and base-10.
This works flawlessly and accurately. And I can SEE that it’s working flawlessly and accurately because I’m calling a print string with the output data of “the math” and it’s updating to the ms. This works the exact same regardless of whether I’m calling the variable through an actor class from another BP or not.
So say now I range clamp my “total time” from an out range of 525600 and clamp it to a new out range of 1000 (to make things easier).
I output that new 0-1000 value to a print string. Works flawlessly. Runs in realtime to the ms (my above example would be expressed as 437.9714).
I’m trying to use this output to control other things.
For example I create a new float timeline. I make it 1000 seconds long. I feed the exact same data that’s feeding the print string into the “set new time” pin on the timeline node.
And when I hit play I can still see the print string updating flawlessly, smoothly, to the ms (or at very least to the frame), however whatever parameter I’m trying to control with the same data is not updating smoothly at all.
But it’s the exact same data. I could understand if my print string was also choking, but it’s not. So the exact same output driving my print string gives me completely different results when used in ways other than a print string.
No frames, no ticking. You can add whatever extra logic / method to the event in the target actor. And they all get the full timer data in case you need to sample something global, like elapsed time.
It’s just an idea, not sure if applicable in your case but I made an “accurate enough” solar system planet orbit simulator with this method.
Okay so here are the outputs of my both the raw float data and then that same data in a timeline. You can see in the timeline version it updates much less frequently. While in the direct float output it updates as expected.
The “directFloatOutput” attached above is from directly after the clamp node and works fine.
Thanks a lot for taking the time trying to help, it’s really appreciated. I’m going to keep troubleshooting and hopefully find a solution.
I know it works, because if I use a shorter time frame (for example 1 day, rather than 1 year) it seems to work totally as I would expect. Even if I range clamp everything to 1000 as well.
You have to multiply by Delta Time so the rotation is smooth and framerate independent. The Tick event already brings that value for you:
Mind that Delta Seconds is a very tiny float number (perhaps 0.016 or so, depending on frame rate, of course), so you’ll have to multiply Delta Seconds by some larger number (1000, perhaps more, or less) so you have the desired rotation speed or “feeling”.