Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-1
Question by BradleyBeeke · Oct 09, 2013 at 05:31 PM · timelight

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

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ShadoX · Oct 09, 2013 at 05:54 PM 0
Share

http://docs.unity3d.com/Documentation/ScriptReference/GUI.Label.html

avatar image Sisso · Oct 09, 2013 at 06:07 PM 0
Share

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?

avatar image BradleyBeeke · Oct 11, 2013 at 02:40 PM 0
Share

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

avatar image robertbu · Oct 11, 2013 at 05:08 PM 0
Share

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???

avatar image BradleyBeeke · Oct 11, 2013 at 06:04 PM 0
Share

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges