- Home /
Other
Returning to main menu
Hello
When i start on the main menu the cursor is there, but after dying and I return to the main menu from a level there is no cursor and therefore I can't navigate my way through the menu.
Any suggestions as to why it's doing this and how i can stop it?
Thanks
Answer by MusicBoxx · Nov 19, 2018 at 04:37 PM
Is your main menu StateMachine or another scene? How does your script exactly work? I'm sorry, I'm a bit confused here.
After the player dies after a 5 seconds gap Game over manager starts sends the player back to the main menu which is a separate scene.
There is also a Hide cursor script but that isn't attached to anything in the menu scene
game over manager
public PlayerHealth playerHealth; public float restartDelay = 5f;
Animator anim;
float restartTimer;
void Awake()
{
anim = GetComponent<Animator>();
}
void Update ()
{
if (playerHealth.currentHealth <= 0)
{
anim.SetTrigger("GameOver");
restartTimer += Time.deltaTime;
if (restartTimer >= restartDelay)
{
Scene$$anonymous$$anager.LoadScene ("$$anonymous$$enu");
}
}
}
Hide cursor script:
void Start () {
Cursor.visible = false;
Cursor.lockState = CursorLock$$anonymous$$ode.Locked;
}
// Update is called once per frame
void Update () {
}
It seems it's the hide cursor script thats affecting it in some way.