playMaker

Author Topic: save and load [SOLVED]  (Read 2457 times)

amandaip

  • Playmaker Newbie
  • *
  • Posts: 3
save and load [SOLVED]
« on: September 26, 2017, 12:03:20 AM »
hi guys, how to I keep a game object to be destroyed forever on a scene (scene 1) when I switch to another scene and then come back to scene 1 again? something to do with player preferences? how to I set it up? please if you can help. struggling with this problem. I'm a new beginner. thanks
« Last Edit: September 29, 2017, 02:16:20 AM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: save and load
« Reply #1 on: September 26, 2017, 04:08:13 AM »
Hi,

 you need to flag the object using the action "don't destroy on load" action.

 Bye,

 Jean

amandaip

  • Playmaker Newbie
  • *
  • Posts: 3
Re: save and load
« Reply #2 on: September 26, 2017, 11:25:49 AM »
I appreciate your reply, but i think u are teaching me something different. I want the game object to be saved as destroy, not holding it for other scenes. thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: save and load
« Reply #3 on: September 26, 2017, 11:51:10 AM »
Hi,
There are many ways you can achieve this,

A way you can do this is by using a bool variable, when the object is destroyed, set it to true

you can use playerprefs to save the bool but its very easy to hack.
If you want more safety you can get easy save for example.

also if you save/load with playerprefs or easy save, it is saved even when you restart the game.

if you only need it to be destroyed in the current game (so not restarting the game)

You could use a global variable instead

On the other scene you need to do a bool test to see if the object is destroyed,
if so you can destroy or disable the object.

For bigger projects that might not be the best way to do this btw.
Then you will need to learn about Scenes and loading parts of scenes.

amandaip

  • Playmaker Newbie
  • *
  • Posts: 3
Re: save and load
« Reply #4 on: September 28, 2017, 10:02:51 PM »
thanks so much. i think i may try your way first and see how it goes. very good explanation. :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: save and load [SOLVED]
« Reply #5 on: September 29, 2017, 02:52:55 AM »
Hi,

 yes, misreaded your questions :) Kurt to the rescue!!

 Bye,

 Jean