Hi there I got two questions but I think they are in the same ‘main question’…
where is the difference between GameObject.SendMessage(FunctionName) and GameObject.FunctionName? and
between GameObject.Component and GameObject.GetComponent(Component)?
So, the only thing I know is, that you aren’t able to call all components and in no way scripts with the shorter way. Is GameObject.Component only shorter for often used Components?
thanks
SendMessage calls the method you give in the parameter on every script of the gameobject, GameObject.FunctionName points to a method in GameObject class, the methods you can call that way are coded into the GameObject classs by Unity.
GameObject.Component is the same, there are some built in properties in GameObject class, referencing the rigidbody, collider etc. with GetComponent() method you can find other components and your custom scripts.
So in short, GameObject.GetComponent() or GameObject.transform are internal (not to be confused by the C# access modifier) methods and properties of the GameObject class but GameObject.GetComponent() returns your custom components you add to the gameobject.