playMaker

Author Topic: Resetting a scene [SOLVED]  (Read 2733 times)

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Resetting a scene [SOLVED]
« 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
« Last Edit: November 24, 2012, 08:08:28 PM by Avascar »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Resetting a scene
« Reply #1 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
Best,
Sven

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Resetting a scene
« Reply #2 on: November 24, 2012, 07:01:24 AM »
Wait so I just do LoadLevel?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Resetting a scene
« Reply #3 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.
Best,
Sven

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Resetting a scene
« Reply #4 on: November 24, 2012, 07:25:16 AM »
Sorry about that, but thanks for helping me. It's 4:24 AM here  8)

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Resetting a scene
« Reply #5 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.
« Last Edit: November 24, 2012, 07:33:51 AM by kiriri »
Best,
Sven