Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

When it's safe to get rectTransform.position?

$
0
0
I get wrong values if I call it on Awake or on Start if I don't wait a reasonable time (Example: 1 second):

Code (CSharp):
  1. IEnumerator Start() {
  2.             Debug.Log("Start (0) - Position: " + rectTransform.position);
  3.  
  4.             yield return null;
  5.  
  6.             Debug.Log("Start (1) - Position: " + rectTransform.position);
  7.  
  8.             yield return new WaitForSeconds(1f);
  9.  
  10.             Debug.Log("Start (2) - Position: " + rectTransform.position);
  11. }
It's there an approach to know where...

When it's safe to get rectTransform.position?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>