Hey everyone! I have recently noticed a very strange issue with the transform.position setter. When setting this in a LateUpdate function I have noticed immediately after setting a value it is not the desired value. Below is a small code snippet.
LateUpdate() {
transform.localScale = new Vector3(0f, 0f, 1f);
transform.position = new Vector3(0f, 0f, 0f);
if (transform.position.x != 0) {
Debug.LogError("No change at X position: "+transform.position.x);
}
}
In this snippet, the debug statement somehow get called. Does anyone have any idea why this may be occurring?