'Path' does not denote a valid type

Hi all, just getting started, and I’ve run into a pretty frustrating snag. I clicked the ‘enable js support’ button (I’m using js), which seemed to work just fine.

However, I’m getting an error when I declare private var path:Path, saying that “The name ‘Path’ does not denote a valid type”. likewise, the same error shows up when I write function OnPathComplete (p:Path)

What’s particularly weird is that I’m able to use the Seeker class just fine; Seeker.StartPath() even draws the line in the inspector and everything. I also double checked that Path.cs is sitting right where it’s supposed to be, in Assets/Plugins/AstarPathfindingProject/Core, and it’s definitely compiling.

My only guess is that it may have to do with js not supporting abstract classes, but I also haven’t seen anyone else with the same problem… any help would be much appreciated!

Hi

Have you imported the “Pathfinding” namespace?
You need to have

import Pathfinding;

At the top of the script to be able to use the classes in that namespace.

perfect :smile: . thank you so much for the quick reply

1 Like