Background 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 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 ArticleHow do I save the index when reloading the scene
I have code - a small player that switches tracks in an array. I need the trackIndex of the last scene to be saved when reloading the scene, how do I do this? For example, tracks 1,2,3 were played....
View ArticleDontDestroyOnLoad issue
Hi everyone I was using unity 2019.4.38f1 Version. When creating a character (with Prefab), the character was created in the MainScene (not dontdestroyonload). Recently I upgraded the Unity...
View ArticleDon't Destroy On Load Gameobject Freezing when returning to spawned Scene.
Whenever I enter a scene with my do not destroy on load gameobject and then go back it will freeze and I check all the scripts and everything is enabled and not kinematic and the velocity will still be...
View ArticleDon't Destroy On Load Object Destroying on Spawn
Only one Instantiated player that used Don't Destroy On Load will be spawned the others will be removed immediately. Don't Destroy On Load Script: void Awake() { InstantiateController(); } private void...
View Articlehow i can keep sound playing even i exit the game ???
i want **keep** the voice or music playing even i **Lockout the screen** or **exit** the game. thank u for helping me :)
View ArticleData held in Don'tDestroyOnLoad disappearing on scene change
Hey guys, So I have a game manager script that uses the DontDestroyOnLoad function to stay persistent across scene changes. The game manager holds an instance of a custom class called ShipInfo.cs,...
View ArticleGet Audio Source Component from GameObject
Currently working on a VA system that requires me to keep the audiosource I made previously inside a game object. Only issue is that there are multiple different audiosources in that gameobject and I'm...
View ArticleHow can I disable dontdestroyonload for only one scene?
So I am using Dialogue System for Unity and i need to disable dontdestroyonload for my game over screen but i want to keep it for the next level so i need dontdestroyonload for my second level but I...
View ArticleScript getting destroyed before it can fully execute a second time during...
Hey all, I'm in the middle of a game jam working on an RPG. I've built a random spawning system and I've been working on creating a proper fade transition for overworld scenes. At the moment it's...
View ArticleAudio To Continue when Restart the Scene
- I have a scene named "Main" which has a Game Object named "Audio Manager". - "Audio Manager" has the component Audio Source attached to it, which has an Audio Clip assigned, and the Loop is ON. -...
View ArticleHow to stop music in next scene after using dontdestroyonload
Hi everyone! I'm a kind of newbie in Unity and C#. I'm making a little project. In the game at the end of each level it appears a minigame with a scene change. The minigame consists in guessing a word...
View Articledontdestroyonload not working on objects
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...
View ArticleChange camera fov and sensitivity from one scene and keep the values for the...
Hello! I've made a small scene where the player can move around and test out their prefered field of view and sensitivity. I have one main menu scene, this "fov and sens" scene and the rest are game...
View ArticleObject.DontDestroyOnLoad problem
Object.DontDestroyOnLoad Is keeping the not unloaded game object in another DontDestroyOnLoad scene and i still cant access it. Can someone help? If not can someone just say me how to move Game objects...
View ArticleObject.DontDestroyOnLoad problem
Object.DontDestroyOnLoad Is keeping the not unloaded game object in another DontDestroyOnLoad scene and i still cant access it. Can someone help? If not can someone just say me how to move Game objects...
View Article