Hi,
As stated above, I’m trying to initialize a UI element at the current mouse position. I’m using the code below to position a panel at mouse position. The problem is, after initialization, the panel keeps following the mouse, making it impossible to click on. How do I initialize it at clicked position but then have it stay in place?
Thanks a lot
Example code:
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
Vector3 mousePosition = new Vector3(x + 20, y - 40,0);
_inspectionPanel.transform.position = mousePosition;