i have this script on certain objects because they don’t work as soon as they’re destroyed. but, when i run the game in the editor and load a scene, it still destroys. i tried adding the debug log message to see if it worked, and it didn’t. there are no errors and i don’t know what to do.
if anyone knows the solution, please type it in the comments. thank you!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DontDestroy : MonoBehaviour
{
private void Awake()
{
DontDestroyOnLoad(transform.gameObject);
}
private void Update()
{
Debug.Log("amongusoi");
}
}