Error ‘UnityEngine.Transform,localroation.get’: cannot explicity call operator or accessor
this happens with every c# script.
Please Help!
localroation needs to be changed to localrotation.
I did and I still get this error!
The error you’re getting is when trying to get/set a game object transform local rotation without a Vector3/Quaternion?.
Rotation and localRotation, both represent Quaternion angles, one World, the other Local Space. The rest of your code is the same.
eulerAngles Returns the euler angle representation of the rotation.
public Quaternion rotation = Quaternion.identity;
void Example() {
rotation.eulerAngles = new Vector3(0, 30, 0);
print(rotation.eulerAngles.y);
}
You can set a new rotation, to a new Quaternion like the example below.
public Quaternion rotation = Quaternion.Euler(new Vector3(0, 30, 0));
I got this error when working with a physics ‘Audit’, where I had to gauge local rotation ie, is my bmx bike flipped over?, did it rotate in the air? on which axis, and how many revolutions?
How Can I tell a Double back flip from a single front flip?
anyways…Good luck, this topic, rotations, is not for the faint of heart!!
Needs to go under “Programming” Thread
p-
The rotation part has to be uppercase localRotation:
it’s not the script It has something to do with my computer. I think
Let us see your code.