When I reload my Scene, nothing works. I think it's because of a...
So when I reload my scene, no scripts work. Everything is where it should be... but I cant move, nothing spawns etc. I'm pretty sure it is something to do with a DontDestroyOnLoad object that spawns...
View ArticleWhen I reload my scene, why does nothing work? dontDestroyOnLoad
When I reload my scene or leave it and go back to it, nothing works. Player cant move, objects wont spawn etc. I think it has something to do with a dontDestroyOnLoad gameObject that gets created when...
View ArticleIs there a way to activate a timer from another scene?
I made an energy system lately and it only starts regenerating and losing the energy when the Scene that has the Energy GameObject is opened. I am wondering if there is any way for the timer to start...
View ArticleAfter going to the menu scene and back to the game scene, an error occurs...
I have a problem re-entering the game scene after the menu scene. On the first launch, everything works fine, but as soon as you go back to the scene with the menu, and back to the game one, an error...
View Articleis it more performant to have an instance of one object in every scene or...
I'm working on a transition system and watched a tutorial from Brackeys. What they did is put an object called LevelLoader in every scene. The LevelLoader animates a Canvas where the Entry is a fade in...
View Articleis there any way to keep first gameobject that has dontdestroyonload script...
hi i have a gameobject as ad manager that get a banner ad from server, the problem is that the server just send to me once per every games run, and if i reload scene i cant show banner, so add...
View ArticleHow do I destory the enemy and item so they don't respwan after reload the...
I am stuck on this for 2 days now, can anyone help me please. I am making a grid base dungeon explore game. The issue is when the player go to the next floor ( trigger next scene) and come back, all...
View ArticleCan anyone give an example how to make a unique ID for each enemy or pickup,...
I am a newbie in unity, can anyone help me with an code example, please. I have watched many tutorials about save/load data persistence, but I still have no clue how to make sure the enemy is dead...
View ArticleCharge object on all scenes
I used DontDestroyOnLoad(); to keep an object on all scenes, the problem is, the object only charges when game starts in the scene i placed it, on build works well, but if i load another scene in the...
View ArticleHow to have different background music through different scenes?
I have a lot of 2D scenes, and I want Scene 1 - 3 to have the same background music playing seamlessly if the user changes between them. However, I also want to change this background music so that...
View ArticleDontDestroyOnLoad isnt working
I have created a script which creates an object and brings it to another scene. Up to this point everything works, but if I use my Restart () function (if I've lost the game) this object is simply...
View ArticleDestroyed object in DontDestroyOnLoad does not recreate in its main scene
I am trying to reset the game when I press R, my player is created in Scene1 ie the main scene and then it goes into the DontDestroyOnLoad scene so as not to be destroyed in the scene change, so I have...
View ArticleCalling variable within DontDestroyOnLoad() script yields different result...
I have two scripts, GameMaster and ItemCollector. **GameMaster script:** public class GameMaster : MonoBehaviour { private static GameMaster instance; [SerializeField] public int maxCherries;...
View ArticleDontDestroyOnLoad causing update to not work in next scene?
So I have an object on a timer. The timer goes between scenes. The timer counts down using : private void Update() { timer -= Time.deltaTime; } In the original scene, the timer counts down as its...
View ArticleWhy does the panel of the new scene not load after I switch scene?,Why does...
> I attached DontDestroyOnLoad and the same script to both of canvases.>> When I load the other scene I only destroyed this panel.>> The new scene had seemed like to be loaded correctly...
View ArticleWhy does my slider properties go missing when switching scenes ?
My slider properties are missing when i switch scene from the main menu. Why does that happen ? Here's my code on the main menu where my Slider is: using UnityEngine; using UnityEngine.UI; public class...
View ArticleWhy is the value of my variable being reset when changing scenes?
I have an object that in the start function it has DontDestroyOnLoad(theGO). Just before I change scenes I get a reference to a prefab and set it to creatureEncounteredGO, then change the scene. I have...
View ArticleHow to stop seamless music after loading a specific scene
I have seamless music playing in my menu of my game (dont destroy on load), but i want to stop the menu music when i boot up a level. Is there any way i could possibly do that? here's the script: using...
View ArticleDon't Destroy On Load makes the object not interactive in the new scene
I am supposed to be able to click said object, but unity does not detect me clicking on it - it behaves as if there was nothing there. Is it because Don't Destroy On Load is its own scene? How can I...
View ArticleDontDestroyOnLoad vs Hideflags.DontSave
What's the difference between DontDestroyOnLoad vs Hideflags.DontSave. I have an audio system in form of a scriptable object. It has some functions like PlaySfx or PlayMusic that other objects can...
View Article