Hello.
In testing script we define the 0,0 position.
So if we move the default unit and still testing the path, the test still start from 0,0 not from the unit.
Normal.
If I replace
GridPosition startGridPosition = new GridPosition (0,0)
by
GridPosition startGridPosition = unit.GetGridPosition();
And in my unit field in unity I’ve placed the first Unit in the scene, when I move my unit, and press T, the drawing lines start from the new unit position.
Cool.
But If I select the other unit, the drawing lines start from the first unit position.
Normal it’s the one we have put in the unit field in unity in the testing Game Object.
So i would want to draw the line from the current selected Unit.
My idea was to create a
private UnitActionSystem unitActionSystem;
to reach the method GetSelectedUnit and transform the code in :
GridPosition startGridPosition =unitActionSystem.GetSelectedUnit().GetGridPosition();
But when I launch the game, select the other unit and press T I’ve a error message with missing element.
For me write unitActionSystem.GetSelectedUnit is equal to write unit because it returns unit.
And after I try to reach the GetGridPosition.
I’ve no error message in Visual studio.
So where is my mistake please?
Thanks.
François