- Home /
Locking the cursor in the center of the screen
I know this is asked various time. I need to be able to set my cursor at the center of the screen so that the camera can look at 3D text for my menu.
Basically I have a menu made up of 3D text and the camera has a mouse look script on it. I want the cursor in the middle of the screen so that when the GUI cursor (which is already at the center of the screen) activates the 3D text when an OnMouseEnter function is called.
If you need any more information just say.
Answer by Crystalline · Oct 12, 2013 at 06:46 PM
Not sure if this is what you need...but.
This will reset and keep the mouse at the center of the screen every frame.
function Update()
{
Screen.lockCursor = true;
Screen.lockCursor = false;
}
Sure this works great in the build but in unity it just locks where ever the mouse is to begin with but hey.
Your answer
Follow this Question
Related Questions
screen.lockcursor locks the cursor in wrong place 1 Answer
One Last GUI Question 1 Answer
Locking cursor Issue - Flash 1 Answer
Unity 3D Screen.lockCursor Problems 2 Answers
Lock the screen 1 Answer