Сursor Center of screenand toggle on and off (Unity 5)
for some reason when I turn on the inventory the cursor just does not appear and if it appears he is not moving he just stands in the center of the screen
public class CursorManager : MonoBehaviour {
public static void HideLockCursor()
{
Cursor.visible = true;
Cursor.lockState = CursorLockMode.Locked;
}
public static void SnownUnlockCursor()
{
Cursor.visible = true;
Cursor.lockState = CursorLockMode.Confined;
}
}
and
if (Input.GetKeyDown(inventoryKey) && pauseManager.isPaused == false)
{
isShown = !isShown;
if (isShown == true)
{
CursorManager.SnownUnlockCursor();
}
else if (isShown == false)
{
CursorManager.HideLockCursor();
}
}
What is the problem ? if you need more informations write I will add
Comment