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

Standalone server -batchmode isn't using GameObject.Find() to get reference...

Hi, I have setup a standalone build of my game that will automatically switch to running as a server when ran with the -batchmode option. This seems to work fine for me when I am testing it in the...

View Article


Problem with Awake

I have a Canvas with DontDestroyOnLoad attached to it. I have only two things on that canvas, MoneyText and PointsText. When i call Application.loadLevel points should be restarted, but they aren't....

View Article


Help with exception to DontDestroyOnLoad

I'm having a bit of a complicated issue so bear with me while I try to explain it. Each level in my game is divded into 3 seperate scenes. Each scene represents a different stage of "alert". (For...

View Article

Trouble with DontDestroyOnLoad

I have main scene (street) and many child scenes (houses), to which I can come from the main scene. When I come to one home, then go back to the street, I want to have player object place near that...

View Article

Implementing damage formula class

Hi. I'm implementing damage formula class for rpg game with Unity3D. This class reads formula data from json file and parse it using...

View Article


Input Field between scenes

Hello, I have a game with multiple scenes and I want to reuse the same input field on all the scenes. I have used "don't destroy on load" and indeed the input Field is not destroyed. The problem is...

View Article

unable to use dontdestroy on load

using UnityEngine; using System.Collections; public class onClick : MonoBehaviour { public void Options(string optionMenu){ DontDestroyOnLoad(gameObject.GetComponent()); Application.LoadLevel...

View Article

Set location Rotation when changing a scene

I'm working on an virtual museum. The user find himself inside a museum hall (scene 1) and then he is able to cross different paintings and then being redirected to a different scene in each painting....

View Article


Save state of sprite between scene switching

Hi! I've been trying to solve this bug for a while now where I have a sprite that transitions into a different image on a mouse click. However I am unable to *save* the state of this sprite in between...

View Article


How do I save the high score from the game scene onto the main menu scene...

I've been watching tutorials and reading similar topics but to be honest, I'm not finding them very helpful. So far, I've successfully managed to use *Dontdestroyonload* and *PlayerPrefs* to display...

View Article

Countdown Timer

I am trying to make a script that counts down the timer and stays in the same place and keeps counting down through 3 levels. I wrote this: using UnityEngine; using System.Collections; using...

View Article

How to stop objects you picked up from reappearing when you go to another...

I'm very new to Unity, but I would like to create a game in which you go to different scenes (levels) and collect lots of the same item, which is then used to open new stages of the hub world. The...

View Article

Play different music depending on the current scene

Hello! I have a music player object that has a DontDestroyOnLoad function so that the music plays throughout multiple levels. I want it so that when it gets to a certain scene it changes the music....

View Article


DontDestroyOnLoad make errors

I have 2 scripts: first one is a script attached on all items of my scene and adds these on inventory; second one is the inventory system script attached on a gameobject with all inventory scripts...

View Article

How do I call an DontDestroyOnLoad function on UI text

![alt text][1] ![alt text][2] [1]: /storage/temp/72372-score.png [2]: /storage/temp/72371-build-settings.png I called an don'tdestroyOnLoad function on two scripts and it doesn't seem to work . I need...

View Article


How do I call DontDestroyOnLoad on the root object, on canvas object.

I trying to carry my text over in the next scene and I having problem doing that. I coded scripts the best way I can . I gotten this error DontDestroyOnLoad only work for root GameObjects or components...

View Article

DontDestroyOnLoad works in editor but not on android target

Hello there, I am having problems with DontDestroy on load. SETUP: I have a GameObject called ActiveLoading. It basically gets activated for fading scenes out and in, for loading something from...

View Article


Trigger audio clip on load level async (only playing for a fraction of a second)

Hello, I want to play an audio clip once I set a level to load (using loadlevelasync), but am struggling to get this to work. I'm checking to see if a bool is set to true in the loadlevelasync script:...

View Article

Dont Destory OnLoad for music background did not play after change Audio Clip

using UnityEngine; using System.Collections; public class SoundManager : MonoBehaviour { public static SoundManager control; AudioSource audioSource; public AudioClip[] audio; public bool isPlaying;...

View Article

Private list is serialized inside a prefab

Hello, I have a prefab with a protected list. The list is serialized inside the prefab, even when I stop the editor. I have no clue how this is happening. The problem is when I play the editor, the...

View Article
Browsing all 416 articles
Browse latest View live


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