#Does someone know how to make a save system that work between scenes?

1 messages · Page 1 of 1 (latest)

gloomy notch
#

Hi, I have this code that stores the player's position but it does not work to save the position between scenes. My player and it's UI can travel from one scene to another so the only problem is that I need to save it. If someone could help me I would be so grateful.

idle voidBOT
cinder cargo
#

Hey

#

I can help you with that

#

The problem comes at the level of the load game function

#

Instead to make

Gameobject.FindGameobjectWithTag(".....
#

First do

GameObject player = gameObject.Find("Player")

Then

player.transform.position = saveData.position;

This is just an example

unique flower
#

both are trash

#

best to serialize the reference or use awake to cache it from a FindFirstByType