I am confused about how to access game objects or components in unity with GetComponent<>.
If for example I wanted to access the position of a game object named player that also contains a script called player how would I use getComponent for that? Or is there another way of doing it?
Also how would I access variables inside of a script with getComponent? I'm just confused as how to use it because sometimes it will work and other times it will throw errors.
Also when accessing a game object, when do I capitalize or not capitalize GameObject?
As you can see I am very unsure as to how this works and I am new to unity, so any answers or help would be appreciated.
Thanks in advance.