|
Hi!. I wanted some random number to appear in my screen every few seconds depending on the set interval but, I've discovered that Unity3D can't maintain the time interval fixed and sometimes get stucked. Is the setting of the text in Guitext well written?. Maybe I've made a bad conversion but I can't explain the variability of the time when I watch the numbers appear. Maybe there's other way to implement this simple question. Here you are the code. private var number:int; function Update () { }
(comments are locked)
|
|
Okay, I couldn't find anything wrong so I ran it on my machine and it worked fine. (I hate it when programmers say that, but yeah..) :P The only thing I can think of is a bit embarassing, but... you're not confusing it choosing the same random number twice in a row with it not changing, are you? :) The other thing I noticed is that the Inspector value doesn't change unless I click away from it and back, but the on-screen value changed fine. You can put a Debug.Log(number) line in there to check that it's running properly. The only other possibility I can think of is that you're maybe adjusting my_time or interval elsewhere in code. HEY!!...That's the right answer!!: it's possible that due to the nature of the Random function randomly I generate two times in a row the same number and it gives the sensation of a more persistent number in the timeline. THANK YOU VERY MUCH!. Problem solved.
Mar 23 '12 at 09:35 AM
jorgon
(comments are locked)
|
