Changing from Tower mode to Grid mode issues



  • Hello!

    I'm making a desktop version of the game, and im able to build towers on my grids perfectly in tower mode.
    But i need to do it in Grid mode instead, however, i'm getting an error that i cannot really make sense of.
    When i select a tower on the grid i get a NullRef on this line in the CreateTower() function:
    if (checkbox.isOn)

    Can you help me? :)



  • Hi there,

    the UI in the desktop scene is not meant to be used for build mode Grid. You are getting an error because the script expects Checkbox components on the tower buttons, so it can highlight the selected button and deselect all others. See the mobile scene on how it works for build mode Grid - you could make a prefab out of them and replace the existing buttons in Level_Desktop.


Log in to reply