- Home /
WorldToScreenSpace gives one answer in Start, then another later?
Hey guys,
Noticed something funny. While running in editor, with maximize on play, if I take a very simple bit of code to spit out the screen space location of any random object in the camera's view on Start, it gives me one value when Start is called, but if I then check that same screen space location a beat later without moving the object, the value is very often different, sometimes by a fair bit.
I'm just looking at Camera.main.WorldToScreenPoint(dummy.transform.position)) each time. This is slightly messing with my head. I haven't tried this out in a build, but it's making me feel like I don't have a grasp on what exactly is happening with my screen dimensions, or the execution order. The screen space location is always close, but a bit off. Any ideas?
Thanks!
Your answer
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
How to get Unity to ask what project to load every startup? 1 Answer
Making a start screen in Unity 3 Answers
DontDestroyOnLoad() not calling awake/start again 2 Answers
Object reference becomes null between Awake and Start after scene load 2 Answers