#Scyan

1 messages · Page 1 of 1 (latest)

crisp bramble
#

Have you set the value of gridcontroller in the editor

wise pelican
#

Yes it says its set

crisp bramble
#

and the gameobject has the GridController script component?

wise pelican
#

Yes it does

crisp bramble
#

And you've set the value of colliderattack in the editor?

wise pelican
#

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

crisp bramble
#
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

wise pelican
#

curFlowField = gridControllerScript.Move(attackTransform);

#

This line

crisp bramble
#

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);
wise pelican
#

Getting the same line coming back to me

crisp bramble
#

does it log that it is null?

wise pelican
#

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

crisp bramble
#

yeah, i assume its in the move function

#

not this one

wise pelican
#

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

crisp bramble
#

haha

wise pelican
#

Now its directly pointing to the line I mentioned before

#

Dang

crisp bramble
#

can you ss the error?

wise pelican
#

Yeah one moment

#

Nvm that pointed to another debug function 🤦‍♂️

crisp bramble
#

oh lol

wise pelican
#

Commented out 😆

#

Woot woot

#

Its working now

#

Thanks so much sorry for the hold up

crisp bramble
#

all good haha

wise pelican
#

I'm gonna see whats up with the gridDebug

crisp bramble
#

👍