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

Keep a Coroutine running during scene load

I have an audio crossfade running as a coroutine on my audiomanager object. The audiomanager is set not to destroy on load, which seems to be working fine. The track continues to play uninterrupted...

View Article


How to load a scene for the second time with a DontDestroyOnLoad object.

I have a menu scene which has a GameManager component which is set to DontDestroyOnLoad, with a Singleton so that only one instance is ever present. When I try to go: Menu Scene -> Scene 1 ->...

View Article


How to disable DontDestroyOnLoad for particular scene?

I'm making a game and I have 5 scenes for now, and I need DontDestroyOnLoad() because the player can collect stuff on each level and get it back to starting scene (base) But I want to make one...

View Article

How to disable DontDestroyOnLoad on throwables?

Somehow, my interactable and throwable objects are automatically set to "DontDestroyOnLoad" whenever I interact with them (throw, grab, etc). I don't want these items when a new scene is loaded, and I...

View Article

Map select from menu trouble with DontDestroyOnLoad()

So i have a 2 map objects lets call it map1 & map2. When the main menu is started, map1 is on the background, and i also have 2 buttons to change background to map1 or map2. When button 1 is...

View Article


How to disable Dont destroy on load

Hey,I m using a player asset,and it has Dont destroy on load,when I load the next scene(lvl),the player is there and I dont like that,I want to disable it but from where???

View Article

DontDestroyOnLoad still destroys object

I am creating a singleton inside Awake in order to keep one Game Session object at every scene. I am using DontDestroyOnLoad , but it doesn't seem to work. When I load into the next scene. Game Session...

View Article

Execution order of Destroy() and DontDestroyOnLoad() between Scenes

Hello people, I am writing here because i did not found anything helpful for my question. I am working with GameManager, its static Instance and its usage while changing scenes. I have this scenario: 3...

View Article


How do I transfer a gameobject created in one scene to another scene AND use...

I want to use a GameObject I have created in my first scene in a script of an object in another scene, at the moment I transfer the object using the function dontdestroyonload. Can someone help me with...

View Article


Loading scene with a DontDestroyOnLoad

In my game, I have a gameManager which is responsible for managing stats such as the player's health, the current time left to complete a level and conditions for the level. I'm currently attempting to...

View Article

SetActive and Don't destroy on load not working

Hello, buildIndex 0 is my menu, why does my gameObject not setActive to true after I load my menu once again after completing a puzzle? ---------- Regards ---------- using System.Collections; using...

View Article

How to make audio play at once.

My background music starts playing when you get into the main menu. But if I go to another scene and come back to the main menu the background music starts playing one more time. So they are playing on...

View Article

Can't call script from another scene using DONTDESTROYONLOAD().

I wanna alter the variable of senstivityX and sensitvityY of player. MouseController script is attached to the player and camera of the player. The player is in another scene. I wanna change the mouse...

View Article


Don't destroy on load problem

I made the player switch scenes with "Don't destroy on load" but every time i return to the starting scene there is one more player how to fix this

View Article

How to get rid of DontDestroyOnLoad?

So basically I created empty object (MusicBox), I attached music and script with DontDestroyOnLoad, but later I deleted both MusicBox and script, but in my game still appears (MusicBox and script)...

View Article


Character Select Button Putting Info into GameManager Script - Is this Possible?

So I'm a Unity 2D baby and started to assemble the game myself after designing the assets myself. I have a character creation menu with buttons and information attached to each button (e.g. press this...

View Article

Levels dontdestroyonload store answers

Hello, I don`t know very well coding so any help will be very appreciated ... I`m playing with unity and try to create a game quizz game and i need some help if is possible i have 100 questions, and i...

View Article


Which is the Best way to have same objects in every scene?

I am making a local multiplayer game whose purpose is killing other players . There are lots of same objects in every scene like "Pause Panel","Players","Score Panel" and so on. My question is :Should...

View Article

DontDestroyOnLoad on disabled object doesn't work?

Hello, I have some object that I want them to never be destroy so even when I switch scenes, they are not destroy. But sometimes, I need to be disable. But when I change scene, they just destroy...

View Article

Levels dontdestroyonload store answers

Hello, I don`t know very well coding so any help will be very appreciated ... I`m playing with unity and try to create a game quizz game and i need some help if is possible i have 100 questions, and i...

View Article
Browsing all 416 articles
Browse latest View live


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