This feels like a very silly problem to have, but I’m new to unity and c# so I’m having some newbie issues with them.
Basically, I’m not sure the proper way to initialize a Vector with a value. I do
public Vector3 cameraOffset = new Vector3(0.0f,35.0f,-20.0f);
but when I use that vector later in my script its all zeros.
Thanks in advance to whoever answers 
A public variable takes its value from the inspector, not your script. (Except to initialize the variable the first time the script is attached to something, or if you use the “reset” item from the gear menu.)
–Eric
If you were to declare this Vector3 as Private, then its value would be what you expect. But if you declare it as public, then it will appear in the inspector and will then use whatever values are set in the inspector.
More than likely, you manually changed its value in the inspector which is what value it is resetting to every time.
Edit: Damn Eric beat me to it 
Ah, I get it now, thanks!
To understand this better, Google search for serialization - Unity (under the hood) will serialize public fields of components attached to game objects within your Scene/Level and then at runtime when the scene loads it will initialise that script component with those saved/serialized values instead of the ones defined in the script. This all happens before Awake().
1 Like