- Home /
Detecting whether RectTransform is on left or right side of screen (or both)
I need my script to be able to determine whether a RectTransform that is the child of another RectTransform is on the left side or the right side of the center of the screen or whether it spans the center. Unfortunately, the anchors and pivots for each of the RectTransforms could be anywhere, which is (I think) what makes this difficult.
I would have thought there would be a simple way to just find the normalized screen-space position of the corners of the RectTransform or something, but everything I've tried has failed so far.
I've been struggling with this for a couple of days now, so any help would be greatly appreciated!
Your answer
Follow this Question
Related Questions
WorldToScreenPoint is giving me a wrong X position? 4 Answers
RectTransform.position of Panel always 0 in FullHD 0 Answers
How can I set a sprite to be at a different coordinate than its gameobject? 1 Answer
How can I determine what tile I'm clicking on 0 Answers
screen position of element in layout 1 Answer