Due to importing/exporting problems with Blender 2.57b 64bit(stable version) between Unity3d, I will be switching to an older version of Blender, Blender 2.49, which apparently cooperates with Unity. As far as tutorials goes, I will be trying my best to make sure that everything is coordinated correctly as far as using functions, modifiers, meshes, texts, objects, etc. If you are also having problems with Blender 2.57 and would also like to install Blender 2.49, I will provide a link here (http://download.blender.org/release/)
So if you want to keep an object or script that keeps up variables (or for any other reason) when you go from scene to scene, you need to attach a don't destroy on load static function, which goes something like this: function Awake () { DontDestroyOnLoad (transform.gameObject); } The Awake function is call only once, when all the objects in the scene have been created. Read more about it here . DontDestroyOnLoad has what ever is in the ( ) to not be destroyed when creating a new scene. (transform.gameObject) is what will not be destroyed when the new scene is loaded, in this case, it will be the game object and all it's children the script is attached to.
Comments
Post a Comment