- Home /
TransformPoint - different results in Awake() and Start()
Hi guys. I want to take the world position of a RectTransform. I am doing it like this:
Vector3 position = rectTransform.parent.TransformPoint(rectTransform.localPosition);
Don't ask why I am taking the local position and then transforming it to world position. The problem is that when I do that in Awake() the returned position is Vector3.zero. When I do it in Start(), the position is the correct one. I am not moving the rect transform at all, so the results should be the same. Can you tell me why this is happening?
Is recttransform.localPosition the same value in both functions? Is rectTransform.parent the same parent? The answer to those questions is only "yes" if you've logged the values and made sure :)
Your answer
Follow this Question
Related Questions
Awake called after I activate object, not after Instantiate... is it normal?? 2 Answers
If a script is attached to more than one gameObject, will Start() & Awake() run more than once? 2 Answers
Keeping a variable after reloading a scene 2 Answers
Start and Awake running twice? 2 Answers
Function that triggers something as soon as Object is "Set Active" 3 Answers