So I am trying to attach a hitbox to a mouse which I did like this:
public class MenuCursor : MonoBehaviour
{
void Update()
{
Vector2 mousePos = Input.mousePosition;
Vector2 worldPos = Camera.main.ScreenToWorldPoint(mousePos);
transform.position = worldPos;
}
}
But this causes extreme lag. How the hell do I do this without the lag?