Description
A pretty handy dandy asset you can use for a game if you need something to happen based on a current time or simply need a real time clock.
I have it so that it shows the seconds as well as minutes and hours but you can change it to display any combination of the current __Year__, __Month__, __Day__, __Hour__, __Minute__, and __Second__. Simply change line __17__ of the script to what you need. Even if you don't know python, I'm sure you can do it.
Current Time BGE
Other
R
RedFrost
Uploaded over 10 years ago
- Downloads
- 136
- Likes
- 5
- License
- CC0
- Category
- Game Engine
- Blender Version
- 2.7x
- Render Engine
- Blender Internal
- File Size
- 107 KB
Comments (10)
Great blend @NicholasAnderson Handy setup Thanks for sharing. :)
There was a problem with the analog clock but I just fixed it; so if you want to download the updated version, please do.
Thanks, but how can to do to always have 2 digits on the digital clock ?
Go into the python script for the digital clock and you should see some lines that say something like `own["seconds"] = datetime.seconds` just delete those lines and it should work.
Sorry but I do not understand. The Python script to the digital clock contains the indicated lines. Here is the script: import bge from bge import logic import datetime cont = bge.logic.getCurrentController() own = cont.owner time = datetime.datetime.now() own["Year"] = time.year own["Month"] = time.month own["Day"] = time.day own["Hour"] = time.hour own["Minute"] = time.minute own["Second"] = time.second own["Text"] = (own["Hour"] + ":" + own["Minute"] + ":" + own["Second"])
Ok in the last line take out from `own["Text"] = (own["Hour"] + ":" + own["Minute"] + ":" + own["Second"])` ` + ":" + own["Second"])` so you get `own["Text"] = (own["Hour"] + ":" + own["Minute"])`
Thanks, but I think you have not understood the question ? or I badly worded in early ! So, for now, your code displays time like that "19:5:2" and I would like to see "19:05:02". How to do ?
Thank you, it works.
awesome
nice! this is pretty good
Sign in to leave a comment.