Awake() and Start() giving different values on the same script?

I’m getting a different transform position I use

public class Knife : MonoBehaviour
{
    private void Awake ()
    {
        Debug.Log( transform.position);
    }
}

then if I use

public class Knife : MonoBehaviour
{
    private void Start ()
    {
        Debug.Log( transform.position);
    }
}

Things to note: This doesn’t move now. None of its parents move. It’s on a canvas. Which is set to scale with the screen. Maybe this is because Awake happens before the Canvas Scaler component kicks in, and Start is after? I have no clue.

Certainly possible.

As Praetor notes, that’s an excellent theory.

Canvases and other layout components definitely move stuff around in a layout capacity.

Generally, try to do things as late as you can in the startup cycle, to avoid other things not quite being ready.

The rule of thumb is Awake()/OnEnable() should strive to only tickle stuff in this script instance.

Here is some timing diagram help:

https://docs.unity3d.com/Manual/ExecutionOrder.html