|
Novice/starting coder seeks help. I need to pass a variable from one scene to the next for player selection. This loads first:
That code is going to be a component of an invisible box collider (used to detect mouse click) on each 3D player in the level selection screen . Right now for testing, I only have it on the first player(Aggy). ("playerAggy" is the name of the prefab for the player (one of three.) ) In the second scene, I try to instantiate aggy to start gameplay like this:
My basic question is how do I say characterSelected=me and then pass characterSelected to following scenes. Any help appreciated.
(comments are locked)
|
|
You can save the selection to PlayerPrefs or you can use DontDestroyOnLoad to keep the game object and all its scripts from being removed when you change scenes
(comments are locked)
|
|
PlayerPrefs saved the day. Thank you. I did away with ray casting for now-- only buttons-- much easier.
(comments are locked)
|
