Save GameObject state

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Seiryu32
Posts: 25
Joined: Sun Sep 27, 2015 7:45 pm

Save GameObject state

Post by Seiryu32 »

So I have a slight dilemma. My game uses a pre-animated life counter with the mecanim. Once a player dies, the scene restarts. The float variable will save, but the counter restarts as well. Are there any actions to save the state of an object not just the variables?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save GameObject state

Post by Joel »

Hi there,

I'm not sure I understand what you mean by saving the state of an object rather than just saving the variables, because an object is just a group of variables and methods.

You can add support for the Component you're saving in Window > Easy Save 3 > Types (see https://docs.moodkie.com/easy-save-3/es ... -es3types/), and select the variables which need to be saved to save the counter (if they're accessible). You can then use the Save and Load actions to save and load the relevant Component.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Seiryu32
Posts: 25
Joined: Sun Sep 27, 2015 7:45 pm

Re: Save GameObject state

Post by Seiryu32 »

The counter is controlled with mecanim. So like when a player loses a life, it transitions to the subsequent state. When the scene restarts it resets the counter to it's default state. Anyway to save the transition state?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save GameObject state

Post by Joel »

Hi there,

I see. There would be no way to do this using PlayMaker actions. However, there's a thread on the Unity forums here which describes how you might save and restore the state using code.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked