Your problem is that you’re always doing the “DontDestroyOnLoad”, no matter what toggleState1’s value is. Notice how it’s now in an “if” statement in the code below
Hope this helps!
private var toggleState1 : boolean = false;
function OnGUI()
{
GUI.Rect(430, 210, 100, 30); //place actual GUI rectangle code here.
}
function Awake()
{
if(toggleState1 == true)
{
DontDestroyOnLoad(this);
}
}