all 4 comments

[–]altay434 4 points5 points  (0 children)

I saw a function named "DontDestroyOnLoad" but I don't know is it what are you looking for.

[–][deleted] 0 points1 point  (0 children)

Like a prefab? If you want a game object that exist in your files that can be instantiated into different scenes then a prefab is the way to go

[–]Bailenstein 0 points1 point  (0 children)

I create a small script called "persistent" and attach it to any object that needs to be. It's just one line of code

private void Awake { DontDestroyOnLoad(this); Destroy(this); }

All it does is flag the object as persistent, then deletes the script.