I want to be able to use Visual Scripting to keep a timer running regardless of scene changes and especially while the game is closed. This is to enable tracking of duration for tasks that take time, plus the passage of days etc.
I’ve found references to using .NET DateTime info - but I don’t know how to apply that.
There doesn’t appear to be a visual scripting node/function to enable, for example, getting system time or real-world UTC time. As far as I can tell there were some nodes in Bolt but they’ve been removed or have changed names.
I figure this must be a really common function used in idle games, task-queue and building games etc.
My latest thinking on this is that perhaps I need to enable or import some .NET stuff? Perhaps there is a System.DateTime node or data type that only becomes accessible if I add a package?
I’ve checked my Player settings (Project Settings\Player\Configuration), and they are at Mono & .NET Standard 2.1
My hunch is those settings are correct.
Have spent quite a few fruitless hours on this so far. Still - perhaps this is a bigger .NET problem I have rather than just DateTime?
did you figure out how to get the time in between application on and off?
if you havent i just recently learned how and could tell you i spent 2 days trying to solve this
Thank you yes I did. Now I am able to add date time nodes I just add the task start time (real world time) to a saved variable then track its remaining time. If the app is closed when the timer runs out it just sorts out once the app runs.