Can someone explain me better why we use transform.Rotate or transform dot somethin dot something dot something?Is this hyerarchy of class elements like C# does,starting from Class.Method etc?
i think this is the best way to think of it.
click on a gameobject and look at all the components listed in the inspector on the side.
you should see rotations positions and components for material and colliders and whatever else.
All these number and setting can obviosly be changed by clicking your mouse over there and simply changing whatever setting manually when the game isnt running.
every number and setting listed can be changed by code also. So the best way to think of it is telling the script which gameobject, which component you want to change, and what setting in the component you want to access.
when you say “gameobject” you are refering to a game object.
when you say “gameObject.transform” you are asking for access to all the numbers and components you see in the inspector under that object.
when you say “gameObject.transform.Rotation” you are accesing and changing those rotation numbers at the top.
another example. if you see a “renderer component” and wanted to change one of the settings,
you would say gameObject.transfrom.renderer to gain access to that component that handles materials.
you would then specify what setting in there you wanna change. for example to change the color you would then say:"gameObject.transfrom.renderer.material.color.
I hope this makes sence.
Thank you for the answer,but what really confuses me is,let’s take your example:
gameObject.renderer.material.color does color belong to material?does material belong to rendere and so on,or that is a kind of syntax that Unity 3d uses to put together few things into one line and they act as parallel components and not like child of the child.
Does this exist in real C# programming and what is it called in order to find some reading material and to understand this better.
Hope this question is clear to you since my native is not English language but I assume that you understand what I am trying to ask.
By the way,you gave me good explanation how this is made to create that line,but still I need explanation if they are equal components to each other in one line or they are component within a component and what represents first one,second one etc.for example Console (is class) WriteLine (method).So what is gameObject in this case,what is renderer? etc.
Thank you