Production: Quality Testing and Bug Fixing - finnr-b/Nightfall-at-The-Harbour GitHub Wiki
17/4/25: The muzzle flash was bugged. Kept repeating and not moving with the gun UPDATE: The problem is solved. The muzzle flash is instantiated and made as a child of the attack point, located at the gun's barrel. I also created a muzzleFlashDuration so the muzzle flash doesn't repeat.
8/5/25: I had some issues with GitHub while playing the game on Windows. I spent so long working on a Mac at home that playing it on Windows is buggy. The Pause Menu doesn't work, time doesn't freeze, and buttons do not work properly. UPDATE: The problem is solved. The issue was caused by a different screen size, as the monitor I used when working on Windows is much bigger than my Mac. The Pause Menu only works when I play from the Unity Editor. However, a new issue was found when the game was built. The pause menu does not work, buttons can't be clicked, and it looks like time is not frozen when the game is paused.
In my pause menu script, I've written this for when the game is paused:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour
{
public GameObject pauseMenu;
public GameObject ammoCount;
public GameObject playerHealth;
public static bool isPaused;
// Start is called before the first frame update
void Start()
{
pauseMenu.SetActive(false);
ammoCount.SetActive(true);
playerHealth.SetActive(true);
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
if (isPaused)
{
ResumeGame();
}
else
{
PauseGame();
}
}
}
// Hold on a minute.
public void PauseGame()
{
pauseMenu.SetActive(true);
ammoCount.SetActive(false);
playerHealth.SetActive(false);
Time.timeScale = 0f;
isPaused = true;
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
// Ok, back to it.
public void ResumeGame()
{
pauseMenu.SetActive(false);
ammoCount.SetActive(true);
playerHealth.SetActive(true);
Time.timeScale = 1f;
isPaused = false;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
}
// Let me try that differently
public void RestartLevel()
{
Time.timeScale = 1f;
SceneManager.LoadScene("MainGame");
}
// Ragequit
public void GoToMainMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene("StartMenu");
}
// Ragequit 2
public void QuitGame()
{
Application.Quit();
Debug.Log("The application has quit.");
}
}