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

How to get rid of the duplicates created by DontDestroyOnLoad?

I have a UI Text that gives a score based off of how far the player has traveled using this code: public Transform player; public Text scoreText; void Update() { scoreText.text =...

View Article


lines after WaitForSeconds not executing if started the IEnumerator multiple...

I have the below IEnumerator IEnumerator RemoveLine (string line) { Debug.Log("------------"); yield return new WaitForSeconds (1); Debug.Log("********"); drawLine.RemoveLine (line); } Now I have a...

View Article


Quality settings reset after scene loads

Hello! I have a settings menu with an option of changing graphics. When a player dies, the scene reloads. My problem is if the player switches graphics in the settings then dies, the graphics default...

View Article

Instantiate a prefab in every scene

Guys, I am looking for a way to instantiate a prefab in every scene without neither putting gameobjects of it in editor nor another gameobject calling the instantiate. Any idea? The moral: I have a...

View Article

DontDestroyOnLoad not working in built project but work in editor

DontDestroyOnLoad not working in built project but work in editor.How can I solve it?

View Article


I am wondering how to save a int in the background

Hi, I have been trying to make an incremental game. I just started making it, but cant figure out how to save my score in the background. I have tried useing DontDestroyOnLoad(gameObject); , but this...

View Article

Can I create a scene DontDestroyOnLoad in editing mode??

I want some game object always exist in the game. Can I create a scene and the things which are in it don't be destroyed when I go to another scene. I have an idea but I wanna know if you guys have...

View Article

dontdestroyonload scene being created on play? what is this and how do I get...

So I'm new to unity, so I'm not sure what is going on or the correct terminology but bear with me (please). I recently started a new game, everything was going fine, then all of a sudden I notice this...

View Article


DontDestroyOnLoad problem

I have this code that does not work: using System.Collections; using System.Collections.Generic; using UnityEngine; public class inmortal : MonoBehaviour { float a; void awake(){...

View Article


dontdestroyonload object goes invisible and falls through map

so all works well with the trigger event and the character passes to the next level but when it passes it just becomes invisible and falls through the terrain. i added the dontdestroyonload script to...

View Article

static and Don't Destroy On load

Hello all , I am trying to make a static class that I could access from any other unity script in my game and I want it also to not destroy while moving from scene to scene. The main idea is that I...

View Article

Undo DontDestroyOnLoad?

Is there a way to reverse DontDestroyOnLoad? I'd like my character controller to persist across scenes, but that character controller might get switched to a new body during play, and the old body...

View Article

Multiple EvenetSystems in Scene - only have 1 after searching though

So i changed a scene and carried my GameManager object over using dontDestroyOnLoad which i assume had an extra EventSystem, it stopped my UI from working in the new scene. So i tried deleting the...

View Article


Dont Destroy on Load not working ,Dont Destroy On Load only work for Root...

Every time I start my game it comes up with a error saying only root objects work or something in that form.,I have a script to create clones of my enemy, however when every clone or as its called...

View Article

Persistent GameObject Between scene Without Serilization

Hello, Here my purpuse : I want to keep GameObject in a Dictionnary. Problem : When I changed scene my GameObject in my Dictionnary become null. What I tried : Clone / Duplicate / Instantiate - And...

View Article


How do I allow my UI buttons to detect my "GameMaster" object after returning...

My game is structured like this: - The player enters the level select screen and picks a level - The player plays this level, beats it, and returns to the level select screen When first entering my...

View Article

How to hide UI canvas between scenes,UI Panel staying visible between scenes

Hello All, Tried searching online but couldn't find an answer between all the other UI canvas issues people are having. I've created a UI menu that comes up when pressing escape, one of the options is...

View Article


Don'tDestroyonLoad only work for root Objects Warning

Don'tDestroyonLoad only work for root Objects Warning created so many times when i run my project. i use this singleton script public class Singleton : MonoBehaviour where T : MonoBehaviour { private...

View Article

DontDestroyOnLoad dose not work.

DontDestroyOnLoad is not working for my options/pause menu. It works on Esc, SoundManager, EventSystem, and MusicBackground just not options menu. It has sub objects that have to stay aswell. ![alt...

View Article

Continuous AudioSource in DontDestroyOnLoad

My game contains multiple scenes and I want play continuous game music between multiple scenes. For this purpose, I have written code like this: public static SoundManager Instance { get { return...

View Article
Browsing all 416 articles
Browse latest View live


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