My Problem:
After making the GridSystemVisual script only update when needed (instead of on every frame), I noticed when starting the game the selected unit always displayed as if it were at GridPosition 0,0.
I’m pretty sure my events are set up correctly because everything works after I’ve taken an action or changed my selection. This grid will update as expected. It only messes up at the beginning of the game (even with UpdateGridVisual() being called in the Start function).
My Fix:
There were no problems in my GetValidActionGridPositionList or IsValidGridPosition functions. I found that if I set the Unit’s grid position in the Awake function instead of the Start function, it works.
But,
Now I’m getting these errors (line 27 is where I set the GridPosition in the Awake function):
From these errors, I assume this is not the correct way to fix this problem. Any ideas on how this can be fixed?