using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Gamemanagerscript : MonoBehaviour
{
public string TransitionedFromScene;
public static GameManager Instance { get; private set; }
private void Awake()
{
if(Instance != null && Instance != this)
{
Destroy(gameObject);
}
else
{
Instance = this;
}
DontDestroyOnLoad(gameObject);
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
Thank you for the provision of your code, could you provide us with what error you received in the console?
If you are able to find what kind of error result is produced in the Console and give us the reference number to it, it could also help with identifying the core issue of the error.
Looking at your code, it seems most probable it could be a NullReferenceException error for any of the [SerializeField] variables. Still, it’d be more identifiable with the console error.