My “canvas” objects always have a local position of NaN after I close out and open Unity. I try going into Debug Mode, but I still can’t change the values.
It happened to ALL of the children under “canvas”. Could I have done something potentially wrong?
I’m having the same issue; when you close Unity 2022.3.4f1, the editor messes with the scene file and makes some parts NaN for canvas items. one way to work around it is to discard changes from GIT before launching. this is a “bug”, so please mark it as so instead of question so devs can fix this in next version
I have been having the same problem and it’s very annoying to fix it, but I just discovered that if your canvas is a prefab, you can just revert all “changes”, so it goes back to exactly what it was before. Especially useful if the values are not 0.
Hope this helps
The main cause of NaNs and Infinity in hierarchy is animating something to scale = (0,0,0)
Don’t EVER set the scale to zero: it can trigger divide-by-zero errors in the Layout Components of the UI hierarchy.
The proper way to set scales:
NEVER set scale (or any part of scale) to zero or negative.
NEVER use Vector2 because that makes the third term (Z) zero.
ALWAYS use Vector3, and make sure that the .z is either 1.0f, or else your non-zero scale.
Similarly never set scale to Vector3.zero, especially in a UI, because this will cause layout divide-by-zeros and damage all your hierarchy with either NaN or Infinity.