Quantcast
Viewing all articles
Browse latest Browse all 81

Variable won't update (C#, Unity)

I'm trying to make a game with the beginning scene a character selection list. There's also a start button, but I only want it to work if the player selected a player character. The code above is how I'm trying to do it but when I click the start button it always does nothing, even after I clicked on a character. Some help would really be appreciated, thanks! This is my code: private CharacterSelections chal; public bool CharacterSelect = false; public void ClickCharacter() { CharacterSelect = true; } public void StartGame() { if (chal == true) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } } }

Viewing all articles
Browse latest Browse all 81

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>