What did i do wrong?

i want to make a GUI.Box showing the time that the playing is spending on playing. I wrote this code but i get 2 errors

error1: Box is not member of function void
error2: realtimeSinceStartup is not member of Time

Could someone tell me why i get those errors?

it is function OnGUI() not GUI()

and pleas use code tags next time you post code :wink:

Oh i fixed that. i forgot i posted it this way. but i still get the error 2 for the

:confused:

realtimeSinceStartup is a method, not a property;
meaning you should write
Time.realtimeSinceStartup()

Could you explain me this? Im still learning programming. :slight_smile:

Class
A cohesive package of date and the means of manipulating that data. If may be abstract and thus cannot be used to create instance objects, or concrete, in which case in can be used to create instance objects.

Field
A variable associated with a class or object.

Member
A field, method or property of a class or object. Class members – also known as static members – only ever have one copy and are accessed via the class, not via an instance. Instance members have a copy per instance of the class.

Method
A function associated with a class or object.

Object
An instance of a class.

Property
One or two functions or code blocks that are accessed syntactically as if they were a single field. If both the get and set functions are defined, then it can be fully treated syntactically as a field. If only the set function is defined, it may only be written to, not read from. If only the get function is defined, it may only be read from, not written to.

Sorry, i just got confused.
Could you code it under so i can see what you mean? follow the coding and your info. So i can see how everything fits to each other?

Thanks :slight_smile: