Skip to content

Instantly share code, notes, and snippets.

@kiranmaya
Forked from mindryu/LabelManager
Created October 27, 2015 16:34
Show Gist options
  • Save kiranmaya/c613b7d6f0b6400ef742 to your computer and use it in GitHub Desktop.
Save kiranmaya/c613b7d6f0b6400ef742 to your computer and use it in GitHub Desktop.
Unity4.6 World to Canvas Position
label.transform.SetParent(transform,false);
// Canvas = Screen Space - Overlay
label.transform.position = RectTransformUtility.WorldToScreenPoint(Camera.main, pos);
// Canvas = Screen Space - Camera
label.transform.position = RectTransformUtility.WorldToScreenPoint(Camera.main, Camera.main.ScreenToWorldPoint(pos));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment