does this not work in c#
DontDestroyOnLoad;
cuz this does not seem to be working for me
i have it in the start function
It does work but i bet you are using it in a wrong place
You should put it before loading a new level like in this example:
if(GUI.Button(new Rect(Screen.width/2-100, Screen.height-50, 200, 30), "Start"))
{
if(characterSelected.Key > 0)
{
if (savedRoom != "")
{
DontDestroyOnLoad(mainCharacter);
Application.LoadLevel(savedRoom);
}
}
}
the code above is in OnGUI function for the current level, since is creating a button to load desired level.
i hate c# lol but im trying to learn it for my game that involves alot of saving loading and stuff…
what would be a script if you never want the object to delete. like it will always be in the game.