Hey Luckie,
I’m not the most recommended person to answer this since I`m no expert, perhaps @Rob could give you a better reply. But I’ll share my point of view either way.
gameObject.transform.position is a Vector3 and returns a position inside the gamespace, it is not a method, so by writing gameObject.transform.position(-1,0,0); is the same as saying:
int myInt;
myInt(1);
or even:
int myInt;
myInt.MaxValue;
Which won`t work, since both values are {get;set;} that stores a vector3/int value after initialized, you have to use “=” to change the value, and not treat it like it is the Method() or class itself.
While the compiler won`t understand the examples above, it would understand the followings:
int myInt;
myInt = int.MaxValue
or
int myInt;
myInt = 1; // when you use just the number, and nothing more, it is the syntax that says that the number is of the primitive type (int)
or
Vector3 MyVector;
MyVector = Vector3.zero
Vector3 is a structure class, so it has to be initialized somehow, otherwise it will be just discarded in the moment it is created and won`t be allocated at the heap memory.
Every time that you initialize a new Vector3 using Vector3 = MyVector3 (for example), you are allocating it to the memory so the script will keep the value, allowing you to access it just by MyVector3 afterwards, but if you want to change the value within the MyVector3, you will have to give a Vector3 type of value to it such as transform.position (which is a Vector3 already initialized by the GameObject itself) or even Vector3.zero (which is a Vector3 initialized inside the Vector3 class).
That’s why you have to write “new” to change the Vector3 value too, you cant just say MyVector3 = (1,0,0) since(1,0,0) is seen just as a bunch of number stacked together, and you can’t say MyVector3 = Vector3(1,0,0) because the Vector3(1,0,0) won’t be stored to the memory anyhow and is seen just as type until initialized, so you can’t pass a value that “don’t” exists. You have to say MyVector3 = new Vector3(1,0,0) or MyVector3 += new Vector3(1,0,0), when you say that it is “new”, the system will initialized it in the memory as a variable and address the value of Vector3(1,0,0) to it.
The same happens to the class Color. You can say Color MyColor = Color.red; but you can’t say Color MyColor = Color(255f,255f,255f); you would have to say MyColor = new Color(255f,255f,255f).
This is how I understand it, but lets wait for someone with more experience than me to reply.