Hello guys, I am trying to control the cursor with a gamepad, using the WarpCursorPosition() function.
The code I have works in the Unity editor, but when it comes to the actual build, there are problems.
Vector2 ballpos = GameObject.Find("Ball").transform.position;
Vector2 screenpos = Camera.main.WorldToScreenPoint(ballpos);
Mouse.current.WarpCursorPosition(screenpos);
(Please see screenshot). I am wanting the cursor to move onto the green ball, but instead it appears where the white cross is. It seems like it is not taking into consideration the black bars surrounding the play area, and the Y axis also seems to be inverted.
Any help appreciated! ![]()
