Question on implementing RandomPath

First off, thanks for the amazing project. I’ve only been using Unity3D for a short time, and have already bought A* Pathfinding Pro. I’ve been able to implement the basic pathfinding from the documentation.

I’m not quite sure how to implement RandomPath. RandomPath is not shown in the Add Component menu (when trying to add RandomPath the same was Pathfinder on the A* GameObject).

If I try and drag and drop the RandomPath script on to the A* GameObject, I get the following error:

Any ideas what I’m doing wrong to get the random path library added?

Hi

See http://arongranberg.com/vanillaforums/discussion/comment/332/

I tried this code

55: var p : Pathfinding.Path = new RandomPath(transform.position, 20000); 56: seeker.StartPath(p, OnPathComplete);

and it throws this

Ah, you are using unityscript.
You see, UnityScript has no support for optional parameters, so in this case you need to pass all parameters to the StartPath function:
seeker.StartPath (p, OnPathComplete, -1);

Also, that should be Pathfinding.RandomPath since it is inside the Pathfinding namespace.

Also, if you are using the 3.2.x versions, you should not use constructors, instead use this syntax:
var p : Pathfinding.Path = Pathfinding.RandomPath.Construct (transform.position, 20000, null);
That null parameter is also an optional parameter which needs to be written out explicitly in UnityScript.

You sir are a scholar and a gentleman. Thank you so much. I’ve been in web development for 8 years now, and never have I seen the level of support that you offer, offered by any other person that developed a package that was for sale.

Thank you.

: )