I had a tough time getting the Cursor lock to work as instructed so I made the following modifications to my code. Not sure what caused my issue but this seems to solve it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;
public class DeathHandler : MonoBehaviour
{
[SerializeField] GameObject gameOverCanvas;
FirstPersonController firstPersonController;
// Start is called before the first frame update
void Start()
{
firstPersonController = GetComponent<FirstPersonController>();
gameOverCanvas.SetActive(false);
}
public void HandleDeath()
{
firstPersonController.enabled = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
gameOverCanvas.SetActive (true);
}
}