How To Save and Load player position using Serialization?
Hello everyone! I'm trying to create a script that lets me save some data from my scene to a file, and then of course load that data from the same file. I have been reading about Serialization and BinaryFormatters and all that, I do understand the logic behind it, but I'm having some troubles implementing the examples I've found in my game.
Some things I would like to get some help with is how should I reference my player's Transform to pass it to my BinaryFormatter, it's a 3D game so I need to get the PlayerObject's position and rotation.
I've seen that I should create a class that contains the Player Data I need, in my case, just the player's position and the player health. How should I declare these 2 variables? The player position as a Vector 3, or what type of data? And after that, what should I save to it? my player's transform directly or something like an X value, Y value and Z value?