Last active
October 27, 2015 16:34
-
-
Save mindryu/9be5c80b0fb8801e85ef to your computer and use it in GitHub Desktop.
Unity4.6 World to Canvas Position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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