#Scyan
1 messages · Page 1 of 1 (latest)
Yes it says its set
and the gameobject has the GridController script component?
Yes it does
And you've set the value of colliderattack in the editor?
I used Debug.Log(); to test what part of it was giving me the error and it was calling Move();
I didnt set the value of collider attack because I'm setting it from a targeting script but I have an if statement beforehand that checks to make sure colliderAttack is != null
public GameObject gridController;
public FlowField curFlowField;
public Collider2D colliderAttack;
GridController gridControllerScript = gridController.GetComponent<GridController>();
Vector3 attackTransform = colliderAttack.transform.position;
curFlowField = gridControllerScript.Move(attackTransform);
```Can you try this real quick
so we can see which part is causing the error
weird
could you chuck in
public GameObject gridController;
public FlowField curFlowField;
public Collider2D colliderAttack;
GridController gridControllerScript = gridController.GetComponent<GridController>();
if (gridControllerScript == null) Debug.Log("controller null");
Vector3 attackTransform = colliderAttack.transform.position;
curFlowField = gridControllerScript.Move(attackTransform);
Getting the same line coming back to me
does it log that it is null?
Afraid not
I've just re-read the error, when I double click it it brings me to the line I was pointing at
Buuut
The error itself is blaming this
GridController
{
curFlowField = new FlowField(cellRadius, gridSize);
curFlowField.CreateGrid();
gridDebug.SetFlowField(curFlowField);
}```
Last line
Let me bring up SetFlowField
Oh nevermind thats a debug function let me just try commenting that out and see if that fixes it for now and then I'll see whats up with the debug function
haha
can you ss the error?
oh lol
all good haha
I'm gonna see whats up with the gridDebug
👍