Importing A*Pathfinding plugin issue

Hi all,

I’ve been looking into pathfinding libraries to use in my game and I’ve decided to use Aron Granbergs A*Pathfinding library. I’m currently using the Free version to get to grips with it which can be found here:

http://www.arongranberg.com/unity/a-pathfinding/download/

Whilst I’ve had no issues with using it in freshly created test projects (I.E I have imported the package when the project is created) I am having issues getting the plugin to work when I import it into my main Project which has pre-existing work in there. Every time I import the package I get the following errors:

Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs(335,43): error CS0117: `GUILayout' does not contain a definition for `Label'
 
(Filename: Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs Line: 335)

Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs(360,27): error CS0117: `GUILayout' does not contain a definition for `Space'
 
(Filename: Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs Line: 360)

Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs(362,31): error CS0117: `GUILayout' does not contain a definition for `Button'
 
(Filename: Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs Line: 362)

Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs(598,27): error CS0117: `GUILayout' does not contain a definition for `Label'
 
(Filename: Assets/AstarPathfindingEditor/Editor/AstarPathEditor.cs Line: 598)

This is just a snippet of it but the error is the same regarding GUILayout not containing definitions. The errors mean the components aren’t created for me to work with.

I’ve tried:

  • Iimporting the library into one project, then configuring it and copying it back into mine but that didn’t work (didn’t really expect it to)

  • Putting everything into a plugins folder. That removes the errors but when I create the PathFinder component I get:

    Instance of AstarPathEditor couldn’t be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.

Moving the required files into an editor folder creates the original errors again.

Does anyone have any suggestions how to sort this?

I am using Javascript for all my other scripts. Could that be interfering?

Thanks,
Mark

Thanks whydoidoit,

It appears that I had created a GUILayout javascript file which it was attempting to access.