I made a tooltip panel follow the cursor with
void Update () {
this.transform.position = Input.mousePosition;
}
in the Update function.
The panel "lags" behind, moving to cursor position after quarter of a second, and its kind of annoying Is there a better way of doing this? Can i somehow "glue" it to the cursor? Here is how it looks when i move mouse from right to left.
Panel IS under the cursor when mouse is still, it only trails off when moved vigorously.
This is a known issue with unity.
While binding mouse position to any gameObject's position, we face lag. This lag is introduced by unity input module's mouse position recording. Reference1, Reference2.
Work Around : You can make your own cursor in game and bind it to mouse position(as you're binding the UI panel). The custom cursor object in game will have the same position as the the panel because both of these objects will derive their position from same source. And you'll get a lag free panel. :)
Remember to hide the default cursor.