pointer not locked to crosshair

i have managed to get a crosshair in teh centre of my screen however the mouse pointer isnt locked to it. is there an easy way of doing this?

If this is for a raycast, you don’t need to refer to the mouse position, you can just refer to the coordinates of the centre of the screen:-

var ray = Camera.main.ScreenPointToRay(new Vector2(screen.width / 2, screen.height / 2);
Physics.Raycast(ray...);

If that is not what you mean, perhaps you can explain a bit further?

1 Like

I know if you locked the cursor it will be centered