2D lesson 28-29 (save)

Can i Save as state?

somethin like

if(click button 0 or 9)
{
load=state;
}

the questinhow doi make the buttoms know in what state am i
if we at state[12] how can i put it in the code to recognize the state and save it
and i want make 8load 0 /7 load 9
?

btw can i save it some how as game when i done and send to friends to try it ?

Hi Alex,

If your states have different names in Unity, you could store the name of the “saved” State in the PlayerPrefs. Look them up in the API or watch the lecture in the Glitch Garden section. If you want to save multiple states, try a JSON object.

To “load” the saved State, you need a List of all State objects, read the name of the “saved” State and compare the name to the names of the State objects in the aforementioned List. If there is a match, you found your “saved” State and you can load it.

Please feel free to ask our helpful community of students for advice in our official Discord chat.

ok thank you :slight_smile: :grimacing: :grimacing: :grimacing:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms