Hey guys, just wondering how i can get my mouse to stay active while in the pause menu, it pops up fine, but then when any buttons are click the Cursor disappears, Have tried with and without 'Cursor.visable = true" and same outcome, have tried looking in Scripting API for Cursor.lockState, but cannot find any coding in relation to C#
Here is the coding for my pausemenu
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityStandardAssets.Characters.FirstPerson;
public class PauseMenu : MonoBehaviour {
public GameObject Player;
GameObject PauseCanvas;
bool paused;
// Use this for initialization
void Start () {
PauseCanvas = GameObject.Find("PauseMenu");
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape))
{
paused = !paused;
}
if (paused)
{
//GameObject.Find("Player").GetComponent<FirstPersonController>().enabled = false;
PauseCanvas.SetActive(true);
Time.timeScale = 0;
//Cursor.visible = true;
} else if (!paused)
{
//GameObject.Find("Player").GetComponent<FirstPersonController>().enabled = true;
PauseCanvas.SetActive(false);
Time.timeScale = 1;
//Cursor.visible = false;
}
}
public void Resume()
{
paused = false;
}
public void Quit()
{
SceneManager.LoadScene("MainMenu");
}
}
Also upon loading the ‘MainMenu’ from the Quit() void, my main camera animation on that scene fails to start, it loads but just sits at the very start without animating.
Have provided a Video to assist in providing the right help.
Youtube Video Link
@crazyKnight
@MikeNewall
@alejandro-unity
‘@’ Tagged due to all posts being moderated upon post