- Home /
Unity 5 Mouse lock?
I get errors after importing the MFPS asset that states for example:
Assets/MFPS/Scripts/GamePlay/bl_RoomMenu.cs(107,20): warning CS0618: UnityEngine.Screen.lockCursor' is obsolete:
Property lockCursor has been deprecated. Use Cursor.lockState and Cursor.visible instead.'
I researched the new function and i changed this:
}
if (! Screen.lockCursor)
{
to this
}
if (Cursor.lockState = CursorLockMode.Locked)
{
i have errors on every single script using that reference... and its causing me to not have controll over the players camera in game... Thanks for your help, Bladejmh (btw im new to scripting)
What's the difference between one equals and two equals?
^^Yep, you forgot one "=" there. The way you wrote it currently means that the lockstate is set to locked every time that if statement is called.
^^Yep, you forgot one "=" there. The way you wrote it currently means that the lockstate is set to locked every time that if statement is called.
@Cherno, no it means that ever time the if statement is evaluated during a build it fails and throws some error about converting the type from the enum type to a bool.
== is asking the variable what it and = and tell the variable what it is
Your answer

Follow this Question
Related Questions
Mouse look Y axis sensitivity doesn't change 0 Answers
If (increasing/decreasing)? check if something is increasing or decreasing 1 Answer
Mouse lock to target 0 Answers
Mouse look and character model? 1 Answer
Centering mouse when not used 0 Answers