0
\$\begingroup\$

This question already has an answer here:

I have a game I'm making in Unity and now I'm stuck on saving. Is it possible to program a game to resume where it left off when you quit? Every time I search for this on Google I get nothing. Can anyone tell me if this is possible or not? And if it is how would I do it?

\$\endgroup\$

marked as duplicate by Pikalek, Philipp, Vaillancourt Jun 1 '18 at 21:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ As written, this is too general; saving & resuming a real time FPS is going to be different than saving & resuming a turn based card game. What type of game are you making? What have you tried & what specific problems have you encountered? \$\endgroup\$ – Pikalek Jun 1 '18 at 20:40
  • \$\begingroup\$ I just noticed that it looks like maybe you asked this question instead of editing your similar, previously closed question. Please don't repost to get around having a question marked as duplicate - if your question was truly different than the flagged duplicate, edit it accordingly. \$\endgroup\$ – Pikalek Jun 1 '18 at 20:49
  • \$\begingroup\$ Try searching autosaving in unity \$\endgroup\$ – sketcherskt Jun 1 '18 at 21:25
  • \$\begingroup\$ "Is it possible?" well, do you have any evidence that would suggest that this is impossible? If you've seen a feature implemented in dozens to hundreds of games, then there's a very good chance it's not impossible. ;) \$\endgroup\$ – DMGregory Jun 1 '18 at 22:12
0
\$\begingroup\$

First, write a standard save function for the game.

Second, when you detect a "close" or "quit" event, call that function.

Alternatively, if the data you're saving is fast/small enough, you simply save constantly. See Darkest Dungeon for an example of a game that saves constantly.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.