edited July 2017 in ORK Scripting
Is there a specific procedure to changing the battle grid via code at runtime?

I'd like to randomize the grid during Start(). I tried;

GetComponent().cellTypeID = whateverTheEmptyCellIDis.

But then the now empty cell doesn't hide it's prefab, so I have to use .HidePrefab() on it. And during the battle the combatants continue to walk straight through the empty cell even though the empty cell is set to block and not passable, so the combatants should walk around it instead?

Is there like a proper way to initialize the grid after changing it?
Post edited by braddon85 on
  • edited July 2017
    Try calling RemoveGridPrefabs on the grid compoment before changing the cell types.
    Set the Settings property of the grid cell component to null after changing the cell type.

    After you've changed call cells, call ShowGridPrefabs on the grid component to show the prefabs.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.