playMaker

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

amandaip

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
save and load [SOLVED]
« on: September 25, 2017, 09:03:20 PM »
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 28, 2017, 11:16:20 PM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: save and load
« Reply #1 on: September 26, 2017, 01: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
    • View Profile
Re: save and load
« Reply #2 on: September 26, 2017, 08: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: 2278
    • View Profile
    • jinxtergames
Re: save and load
« Reply #3 on: September 26, 2017, 08: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
    • View Profile
Re: save and load
« Reply #4 on: September 28, 2017, 07: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: 12351
  • Official Playmaker Support
    • View Profile
Re: save and load [SOLVED]
« Reply #5 on: September 28, 2017, 11:52:55 PM »
Hi,

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

 Bye,

 Jean