Error : cant select grids??on mobile demo

  • Tried to create tower on BuildMode Grid, without selecting a grid. This won't work, aborting. Design your GUI to select a grid first (see the mobile scene)!
    GUIImpl:CreateTower(Int32) (at Assets/3D Tower Defense Starter Kit/Scripts/GUI/GUIImpl.cs:347)

    im not sure what i did but i reinstalled windows and now after i import it, it wont let me select grids or build towers. any help is appreciated thanks!

  • Did you run it on a mobile device?

  • Yea and it did absolutely nothing... and now it works. i have no idea why...  it doesnt work on the desktop though, im not sure if its supposed to.

  • The mobile scene makes use of Unity's touch input calls and is not meant to be run on non-mobile devices. If you have Unity Pro, you can use Unity Remote to play-test it directly without deploying it first.

  • Hi

    It looks like I encountered the same problem as gamemaker5000, but sadly I can't make it go away.
    On mobile device (i.e. Nexus 5) GUI elements like: start button work fine and camera movement joystick (on Level_Mobile) work as it should. But when I try to invoke tower building menu, I just can't. I tapped like crazy on every element on scene, without reaction.
    When I looked inside implementation of GUIImpl.cs in Update() there is this condition:

    	if ((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began || ! && Input.GetMouseButtonUp(0))

    && !SV.control && !gui.IsPowerUpSelected()
                && (!gui.currentTower || SV.selection && gui.currentTower.transform.parent.gameObject != SV.selection)
                && (!gui.currentGrid || SV.showUpgrade && gui.currentGrid || buildMode == BuildMode.Grid
                && SV.selection && gui.currentGrid != SV.gridSelection))

    most part of it is true, except conditions in last line: SV.selection && gui.currentGrid != SV.gridSelection.
    All elements ( SV.selection, gui.currentGrid, SV.gridSelection) are null objects, all the time.
    I'm using Unity 5.0.11f, free version. On Windows 8.1. I done most tests on Nexus 5.

    Could you help me figuring this out?

  • Hi Roman,

    the mobile scene works by touching a free spot in the world (grids), then the tower buttons will shop up and you are able to select a tower for that grid.

    If you can't select grids, verify that the "Grid" layer is actually present in the Tags & Layers settings and your grid prefabs are assigned to that layer. When importing Unity Remote from the Asset Store, it comes with a set of project settings that may overwrite ours. If that was the case, just import our TagManager again.

  • Hi Baroni,
    Sorry for long delay. And I'm really glad for your help. It was it ( I was missing project layers ). Now it works like a charm. :)

Log in to reply