So I feel like I must be missing something that was done in the code while messing about with resetting the game score(I have found a way around my issues yet am working at making sure I understand all this).
Where it was originally put in the sceneloader script when starting back at scene (0). I attempted to move this line of code to a different scene load which I created cause I am smashing all these tutorials into one project and desired to create a menu which was different then when entering the game.
‘’’
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class loadscriptzA : MonoBehaviour {
public void LoadNextScene()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex +1);
}
public void LoadStartScene()
{
SceneManager.LoadScene(0);
FindObjectOfType<GameSession>().GameReset();
}
public void LoadGameChoices()
{
SceneManager.LoadScene(1);
//FindObjectOfType<GameSession>().GameReset();
}
public void LoadBallBreakerGame()
{
SceneManager.LoadScene(4);
}
public void LoadAdventureGame()
{
SceneManager.LoadScene(8);
}
public void QuitGame()
{
Application.Quit();
}
}
‘’’ * I am going to remove the LoadGameChoices. in this I had changed the (0) to (1) on the LoadStartScene. I just don’t know why if I put GameReset under a different load it throws me the nullerror. I have it // where I tried it and it was causing errors.
I edited this post in response to the below… Thanks for that reminder Nina, I really appreciate your help!!