my player character as well as my music component in game has this simple don’t destroy on load script attached, but for some scenes I want the character to destroy on load. for example, when I go back to the menu scene, I don’t want my character appearing there. is there some way to specify which scenes to not destroy on load, or maybe add a script specific to each scene instead of each gameobject?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dontdestroyonload : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
DontDestroyOnLoad(gameObject);
}
}