Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Avascar on November 24, 2012, 06:22:44 AM

Title: Resetting a scene [SOLVED]
Post by: Avascar on November 24, 2012, 06:22:44 AM
Hey all, I would like to know if there's something to do about resetting a scene (putting game objects back, some variables, undoing scripts, ect).

Thanks
Title: Re: Resetting a scene
Post by: kiriri on November 24, 2012, 06:57:38 AM
Hey,
you can just reload the level. It's the only way I know of to actually reset all the physics etc to their original state. I attached an action I always use. It's pretty much exactly the loadLevel action, it just saves you the time to determine the current level.

best,
kiriri
Title: Re: Resetting a scene
Post by: Avascar on November 24, 2012, 07:01:24 AM
Wait so I just do LoadLevel?
Title: Re: Resetting a scene
Post by: kiriri on November 24, 2012, 07:19:37 AM
why yes, I think under the hub it does notice that some (in this case all) prefabs are in the "new" (same) scene too, so it won't empty your entire cache and actually reload your scene completely (I think, well at least it's quite fast).
what else did you expect? The scene stores all the global transforms and if you manipulate attributes on a gameObject in a scene, you'll always be working on instances.
Title: Re: Resetting a scene
Post by: Avascar on November 24, 2012, 07:25:16 AM
Sorry about that, but thanks for helping me. It's 4:24 AM here  8)
Title: Re: Resetting a scene
Post by: kiriri on November 24, 2012, 07:32:09 AM
sure, I didn't want to put you off, it was a fair question, I just happened to have looked it up already myself :P
I do recommend the reload level action though. It will save you the time to get the name or index of your current scene.