move object to mouse position unity 2d code example
Example: unity 2d how to set an object or the mouse position
Vector2 mousePos = new Vector2(camera.ScreenToWorldPoint(Input.mousePosition.x), camera.ScreenToWorldPoint(Input.mousePosition.y));
Vector2 mousePos = new Vector2(camera.ScreenToWorldPoint(Input.mousePosition.x), camera.ScreenToWorldPoint(Input.mousePosition.y));