- Home /
Force UIImage to stay on viewport?
Hi there,
I have a cursor (UIImage) on a Canvas that I move with the arrow keys. I want the UIImage to stay always within the viewport.
I don't know what property should use. I tried converting the rectTransform localPosition into something that I can easily clamp within the viewport but I don't really understand which units is it using.
I have seen plenty of variations of this question but not this one particularly.
Comment