playMaker

Author Topic: Don't Destroy on Load + Arraymaker [SOLVED]  (Read 1420 times)

topscore1632

  • Playmaker Newbie
  • *
  • Posts: 19
Don't Destroy on Load + Arraymaker [SOLVED]
« on: August 17, 2016, 01:16:26 PM »
Hi,

I have a level select screen scene which contains an array with a list of target completion times for all the different levels.

When I load a level from the level select screen I want this array to still be accessible so the FSMs can pull the relevant data from it at runtime, so therefore I've added a Don't Destroy on Load action to the gameobject containing the array.

But...in my separate level scenes, how can I target FSMs to that array when it'll only exist in the scene once it's not been destroyed after a level load?

I've tried making a duplicate but this understandably confuses the actions as there's then two objects with the same name, both containing duplicate arrays. I've also tried destroyable the duplicate once the level has loaded but that doesn't seem to work either.

I've seen mention elsewhere of potentially tagging the duplicate array and disabling it that way - but has anyone got any better suggestions?

Many thanks!
« Last Edit: August 18, 2016, 04:15:29 AM by topscore1632 »

topscore1632

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Don't Destroy on Load + Arraymaker [SOLVED]
« Reply #1 on: August 18, 2016, 04:14:46 AM »
Have worked this out myself after sleeping on it - I've just made the array a prefab and each level has an instance of it. Therefore to change the target times I just need to change the prefab.

Can't believe I didn't think of that sooner!