How to make sure same gameObjects don't spawn after level reload?
So, basically I have this set up where the Main Camera has music playing, and after each level load, instead of deleting the Camera and Player, you move them through each level with...
View ArticleHow does "DontDestroyOnLoad" work?
I want to use it in a gameObject (this gameObject contains a AudioSource Component).I want to keep this music between scenes. Can someone explain me how to use it correctly or a example in javascript?...
View Article'DontDestroyOnLoad' is destroying other gameobjects
HI :) I have a game manager (empty gameobject) which i want to go from level to level as my player progresses. On the game manager, is a score keeping script (in java script), within the 'Awake'...
View ArticleObjects of global singleton aren't accessible
I am trying to create some kind of global class storing player data which could be accessible in the whole project. I created simple singleton using this code: void Awake () { if(Instance == null) {...
View ArticleError UCE0001 And BCE0043 in my code, please help me!
#pragma strict { DontDestroyOnLoad (InvisableWall) : void ; } I've been trying for nearly hours to find what I've done wrong here. I think I need some help with this.
View Articleis it OK to use DestroyImmediate in game?
Hi! Right now i'm using DestroyImmediate to destroy duplicates of a game controller (which is a singleton) that has been set to DontDestroyOnLoad(). The reason why i need DestroyImmediate is that...
View ArticleDont Destroy On Load - Exception
what i want to do is a bit hard to explain so i will try to be the maximum comprensible as i can. i have 2 scenes. and i have my menu manager that doesnt destroy on load with the command line:...
View ArticleHow to access a game object that wasn't destroyed on load?
I have a game object: GameManager, that I want to access from all classes. I've set it in Start() to not be destroyed on load (here is my start function for gamemanager): public void Start(){...
View ArticleSpawn carachters on locations and destroy the manager after level load
How do I spawn my carachters to the coordinates 473 44 1213 Depending on the class it will spawn another carachter and later on destroy the manager object It's hard to explain Sorry for noobish...
View ArticleProblem with audio source playing on awake
I have my audio source set up on an empty gameObject with this code in the Update function: if (Application.loadedLevelName == "mainMenu") { Destroy(this.gameObject); } else...
View ArticleDontDestroyOnLoad duplicate solve test failed.
Hello everyone I have 2 script and im trying that the dontdestroyonload doesnt duplicate the objects when i come back to the first scene i tried to count the tag of the object and if its zero the it...
View ArticleScene changing
How would i go about switching back and forth between scenes and using the DontDestroyOnLoad function without creating a duplicate player gameobject.
View ArticleKeep ads alive even when applicationLoad is called
When applicationLoadLevel is called everything gets destroyed but when i use dontdestroy(gameobject) Gameobject "ads" keeps increasing and never calls the ad? My game is in store the only thing is ads...
View Articlereturning to scene & keeping the Camera
Helloo All I am jumping around to all different scenes. I don't have a character controller only a Camera that I am navigating with So when I go back to a scene I want the Camera in the same place I...
View ArticleDontDestroyOnLoad - how to check if object should be destroyed?
I'm starting a WWWRequest Coroutine from the script of a GameObject. Sometimes this is done right before loading another scene, sometimes not. What I want to do is call DontDestroyOnLoad on the object...
View ArticleDelete duplicate gameobject on restart
Hey, I am new to Unity. I have the following code which creates a main menu : using UnityEngine; using UnityEditor; using System.Collections; using System.Collections.Generic; using System.IO; public...
View ArticleStatic calls to Static GameObject
I have a GameObject called GameManager. I have made it static. It also has DoNotDestroyOnLoad(). Is there a way I can access it by saying GameManager.DoThis() from any scene?
View ArticleIs there a way to stop objects from duplicating?
I have two objects, GameManager and Text, which control the game's scorekeeping and GUI text for the player respectively. I had an earlier issue where if the player went to level two, died, and...
View ArticleHow should I integrate the MVC pattern?
Hi, First of all, I'm sorry for my bad english. I'm wondering which is the best way to implement the MVC architecture pattern in Unity. I'm newbie on using this software but I've some experience in the...
View Articlesingleton, global vars and dontdestroyonload
Hello, I have troubles carrying on my global vars trough scenes. I change the language setting in my menu ingame, then i launch a scene via a new game button and the setting is gone. Here is my...
View Article