Cant find Flee Path

Hi Guys
I was wondering if you could help me with Flee Path. I cant seem to find the script anywhere in my project (I do have A* pro btw), and I’m not sure how I’m supposed to script it if I have to make my own custom script for it. I took a look at the docs but Im still confused, so hopefully you’ll be able to help.

Cheers!
Bodge

If any of you have an example that would be perfect!

Hi

There is an example on this page: http://arongranberg.com/astar/docs/class_pathfinding_1_1_flee_path.php
However there is one miss in it (which I have corrected in my dev version). It does not set the aimStrength field, which is the variable that determines how strongly it flees from the target point.

You can also take a look at the Path Types demo scene which shows how the flee path can be used.

Hi Aron!
I’ve looking through the documentation page, however I cant seem to work out how, based on that example, I would actually make the script. Would it be as simple as pasting
//Call a FleePath call like this, assumes that a Seeker is attached to the GameObject Vector3 thePointToFleeFrom = Vector3.zero; //The path will be returned when the path is over a specified length (or more accurately has "costed" more than a specific value) //This is usally roughly the distance from the start to the end multiplied by 100 int theGScoreToStopAt = 1000; //Create a path object FleePath path = FleePath.Construct (transform.position, thePointToFleeFrom, theGScoreToStopAt); //Get the Seeker component which must be attached to this GameObject Seeker seeker = GetComponent<Seeker>(); //Start the path and return the result to MyCompleteFunction (which is a function you have to define, the name can of course be changed) seeker.StartPath (path,MyCompleteFunction);

Into a new script, or would I put it into an existing script (and if so, where)?

Also, I cant seem to find the demo scenes in my project, I only have an Editor folder. Maybe theres a download link you could provide me with?

Thanks again
Bodge

Hi

The demo scenes should be included with the package. If you do not have them, try reimporting the package.

That script will only calculate a path, not actually follow it. Take a look at these pages to get started with following:
http://arongranberg.com/astar/docs/getstarted.php
http://arongranberg.com/astar/docs/calling-pathfinding.php

1 Like

I feel like an idiot now, turns out the reason I wasnt finding the examples folder is because I was looking in the AStarPathfindEditor folder, I just had to find the one in plugins. Thanks for help Aron, I’ll need those links and have a look through these examples!