DontDestroyOnLoad question

ok. i have a GUIText object with a score script attached and also a script shown below (dont destroy on load)

function Awake () {

DontDestroyOnLoad (this);

}

so my text and score will carry over to a new scene when its time up in my level. im just wondering how to move the position of the GUI text in my new scene without it effecting the position of it in the first scene. at the min the score is displayed at the top left hand side of the screen when playing, i would like it moved to around the centre of the screen on the new scene. i just dont have a clue where to start.

I appreciate any help

You could do this with a gameobject you name "LevelManager". The attach a "levelOne" script to it which finds the GUIText object and moves it in the Start() function. Simply have a different script for each level you want to move it in (or detect the level and move it).

So your game will do this:

  1. Load the new level
  2. Not destroy the GUIText
  3. Move the GUIText

This will all happen so fast you won't see it.

Alternatively you could use Application.loadedLevel to detect what level is loaded in a script attached to the GUIText itself and move it depending on what Application.loadedLevel returns.