Quantcast
Channel: Questions in topic: "dontdestroyonload"
Browsing all 416 articles
Browse latest View live
↧

Scene changing

How would i go about switching back and forth between scenes and using the DontDestroyOnLoad function without creating a duplicate player gameobject.

View Article


DontDestroyOnLoad with object on another scene

So I have an Options UI on my main menu and a pause UI on my level1. I want to make it so when I press the back button, it will go to my pause menu. That currently doesnt work. right now I am using...

View Article


How to stop duplicates from dontdestroyonload

I've already found some solutions online for this, but they don't seem to work for audioclips. Heres what I'm trying to do. private static AudioClip instance; public static AudioClip Instance { get {...

View Article

DontDestroyOnLoad in some scenes

void Awake() { { if( Application.loadedLevelName == "Level 01") DontDestroyOnLoad(this.gameObject); } } doesn't work !! Please, i need help !

View Article

DontDestroyOnLoad

This is my code it doesn't work,please i need help! void Awake() { { if( Application.loadedLevelName == "Level 01") DontDestroyOnLoad(this.gameObject); } }

View Article


Audio or Music to continue playing between scene

Is there a simple way to have audio like a background music track to carry over to another scene without stopping or restarting? but in some scenes and change the music in other scenes, and Thanks

View Article

DontDestroyOnLoad error

So I am using DontDestroyOnLoad for my options and this is the DontDestroyOnLoad code: using UnityEngine; using System.Collections; public class dontdestroy : MonoBehaviour { // Use this for...

View Article

Loading back and forth between levels, creates clone of player

Hello Everyone, I am working on a game where the main character can choose which quest to go on, from his town. The player is already in the town on startup. Once he selects the quest, it loads a new...

View Article


Set light to active depending on if a specific game object is active in...

Hi, In my main scene there are 36 lanterns, which can be set to inactive whilst playing the game. (though some will remain active once the game has ended, depending on which colliders are hit) When the...

View Article


Unity C# Singleton?

I'm trying to make a simple singleton object, basically just exists and spams the console that it exists so I can confirm it works when switching scenes (using Application.LoadLevel(Scene)). This...

View Article

c# Static class dont destroy on load not working

void Start () { DontDestroyOnLoad (this); this.hideFlags = HideFlags.DontSave; // IMPORT SAVES if(parser.DoesExist(IniFiles.CONTROLS)){ LoadControls(); } else { CreateControlFile(); }...

View Article

Don't Destroy on Load return to scene Duplicate Music Object

I have a main menu scene and a options menu scene. I have a cube with no mesh rendered and an audio source with a 7 minute sound track that loops (the cube is in the main menu scene(first scene on...

View Article

Singleton DontDestroyOnLoad data persistance

Hi Im testing singleton pattern with one instance of GameControl to be persistent thru all scenes, but i ran into problem, code stripped to show only one GameObject connected to GameControl using...

View Article


DontDestroyOnLoad

On the start screen (**first scene**) of my game player can disable sound using checkbox. It's value stored in the variable toggleValue. When I load game (**second scene**) and then load **first...

View Article

DontDestroyOnLoad doesn't work

In my **first scene** of my game player can disable sound using checkbox. It's value stored in the variable **toggleValue**. When I load **second scene** I can see, that toggle's value is like it was...

View Article


UI Panel Don't Destroy On Load?

Is it possible say to have a timer on a slide out UI panel not destroy when a scene changes? For instance if I have a trip timer and I set the timer, then slide the panel with the timer on it out of...

View Article

Java Script Dont Destroy On Load Duplicates Game Object

I have this don't destroy on load java script in order to make a timer keep time across scene changes, however when I return to my scene my timer game object has been duplicated!! Is there a way to fix...

View Article


How to begin animated skybox at same point in sequence as when the scene ended?

Hello, My game switches between three scenes. In the first scene I have an animated skybox, and on pressing space a new holding scene loads for a few seconds, after which a third scene loads. (and on...

View Article

gameObjects in array dont persist across scenes

I'm storing gameObjects in a list that is on a gameObject that is set to dontDestroy. The list has missing objects when the other scene is opened.

View Article

best way to send data btwn scenes

I'm not sure what the best way to do this is: I have a level select screen. The objects that represent the levels are all derived from the same prefab. Level data is stored in the class in different...

View Article
Browsing all 416 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>