- Home /
Question by
Vogd · Jul 02, 2018 at 03:07 PM ·
uicoordinatesworld
Gui point to world position
Hi!
I have an ui button in canvas (Screen Space - Camera) and it is aligned to left top corner. How can i get its coordinates in world space?
ScreenToWorldPoint don't work for this!
Thanks!
Comment
Ah that simple...
gameObject.transform.position = button.transform.position
Thats all what i need:)
Answer by hexagonius · Jul 02, 2018 at 08:32 PM
"For case 3 I use Camera.main.ScreenToWorldPoint(rectTransform.transform.position) and it seems to give good results."
it is don't work for canvas with render mode Screen Space - Camera!
Your answer
