N
N
nano_e_t_42022-01-12 14:52:15
Unity
nano_e_t_4, 2022-01-12 14:52:15

How to move the player from one scene to another?

I want to transfer the player object from one scene to another, in a unit. At the same time, save all its parameters, parameters of scripts that hang on the player, objects attached to the player, etc. How can this be done conveniently?
Now I'm transferring through the prefab, to which I load all the attached objects and data on the new scene.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2022-01-12
@nano_e_t_4

Google DontDestoyOnLoad

F
freeExec, 2022-01-12
@freeExec

A) Be able to serialize player states. Conditionally turn everything into json, and load it on the new stage, getting a new character indistinguishable from the old one. (technologically)
B) Load a new scene in addition to the old one. Transfer "physically" the player's gameobject to the new scene, and then delete the old one. (simply)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question