I wrote a script to hide the mouse in my game (FPS Game) and when I press left control I want the mouse to appear and it would be nice if my screen could lock. This is my script, it looks fine to me but I get a Parsing Error and a Unexpected Symbol ‘else’. Thanks for the help and I sorry for any grammar errors, I’m French ! I’m also new to scripting, thanks for understanding.
using UnityEngine;
using System.Collections;
public class MouseHide : MonoBehaviour {
void Start (){
Screen.showCursor = false;
Screen.lockCursor = true;
}
void Update () {
{
if (Input.GetKey(KeyCode.LeftControl))
Screen.showCursor = true;
Screen.lockCursor = false;
}
else
{
Screen.showCursor = false;
Screen.lockCursor = true;
}
}
}