- Home /
Time! from Rotation of Light
Hello and i am making a game with a day/night cycle i have got that working but i want a script that would tell me on the gui text what the time of the game was by angle of the directional light please help
Do you want to know how display a text? How to compute the angle of the sum by the time? UnityAnswer about answer questions. Got it?
i cant get a timer for 75 seconds to pass a varible will change to 3 from 12 then to 6 then 9 so the main hours of a clock i know how to create gui text
I don't understand what you want, and your last comment made it even less clear. Are you trying to format a number of seconds into an hour:$$anonymous$$ute format? Or???
Basically i want a java script timer sorry if i haven't been clear enough. I have given up on the original idea for the clock so i just want a timer that starts and ends i need the time to be a varible if you could thanks
Answer by MFen · Oct 11, 2013 at 06:06 PM
Every degree of the sun is worth 4 minutes (assuming the sun only goes from 0 - 180) So if you get the elevation of the sun just multiply by 4 then divide by 60 for your hours.
So for instance if your sun is 45 degrees up it will be (45 * 4 = 180 / 60 = 3)
Now its up to you where you start your sunup time from just add 4 or 5 to the output number to start the sunrise and it will show 7 or 8
Your answer

Follow this Question
Related Questions
Wait before being able to press button again 2 Answers
How can I add time to a timer on an object collision? 1 Answer
Changing light intensity over time via mathf.lerp 2 Answers
Light Colision 1 Answer
Day Night Cycle Script Not Working? 1 Answer