Time for action - adding a Player GameObject
Add Player to Scene0. We also need to make changes to Scene1 and Scene2.
Click on GameManager and make sure its Transform Position is
0
,0
,0
.Add Player to Scene0.
Set the Transform Position for Player to
0
,1
,0
.Make Player a child object of the GameManager by dragging Player onto GameManager. Why?
Player needs to be able to exist in every Scene
Since GameManager is already allowed to exist in all Scenes as a result of the
DontDestroyOnLoad()
method called inStateManager
, any child objects of GameManager will also be allowed to exist in all Scenes
I suggest adding Directional Light to Scene0 so everything added to the Scene isn't dark.
Make it a child of GameManager as well so that all Scene instances will have light.
Save Scene0 and load Scene1.
Remove any GameObjects in the Scene.
Save Scene1 and load Scene2.
Remove any GameObjects in the Scene.
Finally, reload Scene0 since this is the starting Scene.
What just happened?
When you click on Play and move...