Hi, I’m using Screen space - camera canvas, and the purpose is to display a square-shaped Image UI that fills the starting position to the current position when I drag the mouse.
To do this, I used RectTransformUtility.ScreenPointToWorldPointInrectangle() to convert the starting position to a position that can be used for RectTransform, and I assigned it to anchoredPosition, which shows the rectangle in a strange position a little away from the corner (anchor), as shown in the photo.
I’ve tried ScreenToWorldPoint and transform.position to position correctly, but it didn’t work. I don’t know if there’s anything I’m getting wrong.
How can I put the square exactly in the mouse position (drag start position)?
