I’ve got a script like so to record the x-position of my character,
var xpos : float;
function Update () {
xpos == transform.position.x;
if(Input.GetKeyDown("q")){
print(xpos);
}
}
But I keep getting the error “Expressions in statements must only be executed for their side-effects.” Can anyone tell me why this is happening and possibly how to fix it?