Forum Discussion
RCopelan
Apr 12, 2024Copper Contributor
Accessing Current Date/Time in Visual Scripting
I am attempting to build a "Current Time Clock" to include in our Mesh custom meeting room. Easy to do with a TMP-Text object and attached C# script in Unity but that won't work when building for Me...
RCopelan
May 06, 2024Copper Contributor
Posting 2 solutions to this ... the 2nd one is what I targeted in the begining but just over the weekend found the appropriate nodes. The 1st one was suggested by a colleague and worked well. 1. Using a Webslate in the scene sized and styled to be a clock I displaed a webpage that was hosted on github pages that used JavaScript and CSS to show a clock. The JavaScript ran the clock. Worked very well but does require the page to be hosted somewhere. 2. Visual Script has nodes "Date Time Get Now" and "Date Time To String" . The output of To String can feed a TextMeshPro object. Triggered by an "On Interval" node it is within a fraction of a second of my PC clock. Close enough for my Events. There are other "Date Time" nodes in the picker. I appreciate the external collaboration on this.
- kaipiroskaMay 13, 2024Brass Contributor
Hi, I have implemented an analog clock with Visual Scripting which takes the current time on event start and then updates hour and minute hands every 60 seconds.
- RCopelanMay 15, 2024Copper ContributorThat's really neat. Tnx for sharing