|
Question updated, 1/17/12 11:30 am EST. What i am trying to do is to make the pet's hunger(or food) decrease every 12 hours so the user/player can feed it every now and then. any help would be much appreciated.
1, how to create a constant timespan of 12 hours? (the hungryTime var on top) 2, how to do the 3 line below: */ //error msg end
(comments are locked)
|
|
I answered a very similar question a while ago regarding real time integration with games and affecting "hunger" =P http://answers.unity3d.com/questions/171302/save-current-time-on-quit-then-on-relaunch-compare.html
(comments are locked)
|
|
Dewald117's solution seems a great one. This would solve the first error. About the second error of yours, doesn't seem a legal statement (that's not an assignment). Would you say , maybe?
(comments are locked)
|

Please edit your code, select it, hit the 101010 button to format it please.
can you please say what the errors are?? it is clueless for us... btw is is compiler error or logical error ?!?!
edited it hope it is easier to read now, and added the compiler error
passed time is of type System.DateTime you have to change it to timespan because supraction of 2 times returns a time span not another time!! and also the other error is because u used - instead of -=
Thanks for the help, i really appreciated it.
when i changed the passedTime to TimeSpan, it took care of the error, but now i am getting more road block towards what i want to do. the Question has been edited.