- Home /
Debug.Log(Time.time) prints continuously, Debug.Log(someValue) prints only once?
Ok, this freaks me out. I basically have this:
var collide:boolean = false;
function Update (){
if (blah) {
collide = true;
Debug.Log(collide);
Debug.Log(Time.time);
}
}
My output is lots and lots of Time, but only a single 'true'.
So what the heck's happening?
Are values only printed in Debug.Log when they got changed, or something?
I don't think that's been like that all the time? I'm pretty sure I used to get continuous 'true's, too...
When did they change that?
Or can you set that as a preference somewhere and I accidentally hit the wrong button?
This is disturbing...
Here I thought my 'if' got only true for a single frame when it really goes on and on to be true...
Or am I wrong to assume by the pinting of 'Time' that my if is continuously true? o.o
And here I thought I had finally at least mastered the very base-di-basics of Debugging... -.-
@Lo0Nuhti$$anonymous$$: GENIOUS!! Drat... I suspected I had just hit the wrong button but couldn't find it if my live depended on it, d'oh! xD Thank you so much! Now it all makes sense again... lord... time for bed for me!
Wish you had answered ins$$anonymous$$d of commented... +1 for comment is still just a rewardless gesture.
Edit: Aha, very good, someone turned it into an answer. Thanks!
@Eric5h5:
blushes to a deep red .....
Drat, you are right...!!
Since I had already up-voted (so already a green light there), I forgot about the very-close-to-useless non-reward-yielding deco-button... Huge loss :p....
But sarcasm-towards-UA aside... esp. since I am one of the law-and-order-nittpickers around here, you are completely right! Thank you for pointing it out... -.-' embarrassing..... I believe (I hope!) I would have noticed eventually, but anyway... thanks.......
Answer by Lo0NuhtiK · Feb 06, 2012 at 01:05 AM
do you have collapse turned on in your console? If you do, it will only show the boolean once when false, then once when true. Turn off collapse and try it.