I am Making an Aim trainer, and this is the code for recording certain stats and displaying the game over menu, everything works except my update function never gets called, i have been trying to fix this for hours, redoing the script and trying in other scripts, certain things may be commented as i removed them to initially find the issue, but the issue is that the update function isnt getting called, i would really really appreciate if anyone can spot why :((((
(I have references to other scripts, but they are all fine, just the update method isnt getting called)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameStat : MonoBehaviour
{
public GameObject GameOverMenu;
public int Shots = 0;
public int Hits = 0;
public float Accuracy = 0f;
//public static bool GameEnd;
void Start()
{
print(“Wrking”);
GameOverMenu.SetActive(false);
//TimerOne.GameEnd = false;
}
void Update()
{
print(“working update”);
Hits = Score.score;
if (TargetStart.TimerStart)
{
print(“working”);
if (Input.GetButtonDown(“Fire1”))
{
Shots += 1;
}
if (TimerOne.GameEnd)
{
print(“workinggameend”);
Time.timeScale = 0f;
GameOver();
}
}
}
public void GameOver()
{
Cursor.lockState = CursorLockMode.None;
GameOverMenu.SetActive(true);
Time.timeScale = 0f;
//PauseMenu.IsPaused = true:
}
public void PlayAgain()
{
SceneManager.LoadScene(“Game”);
}
public void GoToMainMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene(“Play Menu”);
//PauseMenu.IsPaused = false;
}
public void QuitGame()
{
Application.Quit();
}
}