A* Pathfinding Project

RichAI.cs, bug(error thrown) since upgrade to v4


#1

I hope I’m writing this in the right section, I have an error since I`ve upgraded to v4.

New scene:
I’m using a Raycast graph on a terrain
have a capsule (with capsule collider)
Rigid body
and Rich AI + Seeker

And the target is set

It gives me
NullReferenceException: Object reference not set to an instance of an object
Pathfinding.RichAI.Teleport (Vector3 newPosition) (at [censured]/AstarPathfindingProject/Core/AI/RichAI.cs:254)
Pathfinding.RichAI.Init () (at [censured]/AstarPathfindingProject/Core/AI/RichAI.cs:233)
Pathfinding.RichAI.OnEnable () (at [censured]/AstarPathfindingProject/Core/AI/RichAI.cs:225)

It does seems to be working fine, but it throws out the error.


#2

Hi

That seems to indicate that you have no AstarPath component in your scene when the agent is created.

I will fix it so that it doesn’t throw an exception either way, but at least that seems to be the cause.


#3

But but… I do =’( otherwise How can I graph?

Seriously, no biggies, like I said, it seems to be working fine.

Keep up the good work!