Y
Y
Yura Milevsky2021-11-06 13:41:51
Unity
Yura Milevsky, 2021-11-06 13:41:51

How to make a normal save?

I have a save that saves only the position, rotation of the characters, it can also scale, but I don't use it like some other functions. If any animation is suddenly played, then the save will not save everything as it is, for example, it will not save the given character pose, and continue the animation from this place. I'm afraid it's completely messed up. How to make a normal save?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2021-11-06
@dollar

Some things need to be preserved and some things don't. For example, you do not need to save raindrops that are randomly drawn across the screen. The game itself will not be able to guess what is needed and what is not, so it's up to you to think everything through.
Consider each tick (or frame) of the game as a separate state. Of course, if the game is in real time, and not turn-based (otherwise - every "step"). So, you need to decide what will go into this state and what is not significant for the gameplay. For example, if you don't want the player to "cheat" against random by loading many times and repeating the same actions, then a seed should go into the save so that the same random actions are repeated every time the load is made. The same applies to animations, if they are part of the gameplay, physics.
In general, the topic is complex. If you continue to google, then use the word "serialization".
Docs : docs.unity3d.com/Manual/script-Serialization.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question