F
F
FixMyLife2018-10-27 17:03:09
Game development
FixMyLife, 2018-10-27 17:03:09

How to implement character loading from one scene to another?

Good day! The essence of the question is as follows: there is a scene with the choice of a character and a scene of the game itself. How to implement the loading of the selected character in the scene with the game? I tried to do it through PlayerPrefs, but it didn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Pogrebnyak, 2018-10-27
@FixMyLife

Suppose the list of possible characters is stored in an array. You can save the index of the selected character in PlayerPrefs, and create it from the array using Instantiate in the desired scene.
If you need to save the desired character when switching between scenes, and not create it, there is DontDestroyOnLoad.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question