Gameobject DontDestroyonLoad references not working after changing scene
Hi, need help in referencing objects in the inspector. I have 2 scenes I,e main_menu and level. At scene main_menu there are a couple of game objects that are dontdestroyonload. on those objects sound...
View ArticleDestroy dontDestroyOnLoad how do I do it?
So what I need to do is keep the score text in levels 1-4 but in the congratulations & game over levels I don't need this information. Basically I need the text & canvas to delete themselves...
View ArticleBest way to deal with DontDestroyOnLoad when returning back to the same scene?
I have a background that is the same throughout my game. It starts in the start screen scene, where I apply DontDestroyOnLoad to it. However, what happens if the player returns to the start screen? I...
View ArticleBackground music doesn't start on new scene load.
Hey all, So I was looking for a way to continue my BGM when the player hits the restart button. I've managed to solve this by creating a game object with a DontDestroyOnLoad line in the code, and it...
View ArticleContinuous audio issue across scenes
Accidentally posted twice because of lag issues. see: "Background music doesn't start on new scene load"
View ArticleBackground music doesn't start on new scene load.
Hey all, So I was looking for a way to continue my BGM when the player hits the restart button. I've managed to solve this by creating a game object with a DontDestroyOnLoad line in the code, and it...
View ArticleScene stores variables after scene reload
Hello, Apologies if this question has been raised but I've not found a solution (Not through lack of trying...) I have a scene that I have a replay button when the player loses/wins. I want to reload...
View ArticleDontDestroyOnLoad not working after changing parent temporary
Hey I have a specific problem with the DontDestroyOnLoad function for my object. In my project i have level loader and the player object can change scenes without getting destroyed. In one level a have...
View ArticleURP Unity second camera (From other scene) not being detected for stacking
I'm using Unity 2020.3.21f1, Universal Render Pipeline Hi, I'm new to this, I'm adding a second camera to my scene through using 'Don't Destroy on load' The Previous scene (Scene1) Has this: void...
View ArticleHow to switch scenes with two players using Photon?
I am making a multiplayer game in which there are two players. Both of the players use the same PlayerController script, as they are from the same prefab which has been instantiated. I want players to...
View ArticleHow to keep the same gameobject with different transform values in different...
What I am trying to do is the have a trigger object at the end of different levels and when the player gets inside an animation plays, and then the next scene is loaded. problem is when I add...
View ArticleDontdestroyonload breaks my scripts
I'm trying to use dontdestroyonload to keep the same player object from scene to scene, it works just fine but when I reload a scene it completely breaks everything. I get error messages saying "The...
View ArticleHow to access GameObject under DontDestroyOnLoad in Hierarchy at run time
Hello I have been trying to access a gameobject called LevelManager which contains a script called LevelManager which has an enum I want to use to change scenes. This gameobject is a child of an empty...
View ArticlePlayer exits don't destroy on load because of moving platform
Hi ! I am working on my first game as an intern, and I need a quick fix because my game has to be done by tonight... So I have a don't destroy on load script that works fine unless my player touches a...
View ArticleSelect element from list only once when reloading new scene
Hello everyone, I'm developing a VR mini game in which the user looks for objects inside a room. At the center of the scene there is something like a tv screen, where an image of the to-be-searched...
View ArticleRandomly select list element and then remove when reloading scene
Hello everyone, I'm developing a VR mini game in which the user looks for objects inside a room. At the center of the scene there is something like a tv screen, where an image of the to-be-searched...
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 ArticleHow to access objects that was not destroyed on load?
I have a game object called "Keep" that's the tag "Keeper" and is meant to send data between scenes and is not destroyed on load, it has a script attached to it called SaveMe.cs In SaveMe.cs... void...
View ArticleHow to access game objects that haven't been destroyed on load?
I have a game object called "Keep" with tag "Keeper" that stores variables between scripts, it has an attached script called "SaveMe.cs" In SaveMe.cs... void Awake() {...
View ArticleMove player between subscenes in open world game?
How can I make sure my player object remains loaded when I constantly load/unload sub-scenes? Should I give it a `DontDestoryOnLoad` ? Should I make it a prefab and instantiate it from an object that...
View Article