- Home /
,Problems with variables
Hi!
I have a question about variables: I was following a course and in the first part the instructor said that there were these types of variables: int, bool, float, string.
Later on in some codes he writes private Player, GameObject, Transform etc...
What are those? And how many there are of them?
Thanks for answering :)
,Hi!
I have a question about variables: I was following a course and in the first part the instructor said that there were these types of variables: int, bool, float, string.
Later on in some codes he writes private Player, GameObject, Transform etc...
What are those? And how many there are of them?
Thanks for answering :)
hello, first, a variable is allways written like this
ProtectionLevel VariableType VariableName;
the protection level is how accesible the variable are, they can be private, public or protected, if they dont have private public or protected it means that by default are private. the variabletype are the "type" there are a lot of types of variables, like you said int, bool, float, string, char, double.... and you can "create YOUR OWN variables" with classes, GameObject Transform and Player are unity specific classes that they have code for you to use