I trying to force feel enemy from player using A* Pathfinding project, but enemy always moving to (0, 0, 0).
Code:
if (isChasing) {
// A score of 1000 is approximately equal to the cost of moving one world unit.
int theGScoreToStopAt = 100000;
// Create a path object
FleePath path = FleePath.Construct(transform.position, player.position, theGScoreToStopAt);
Debug.Log(path.startPoint + " / " + path.endPoint);
// This is how strongly it will try to flee, if you set it to 0
//it will behave like a RandomPath
path.aimStrength = 1;
// Determines the variation in path length that is allowed
path.spread = 4000;
// 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(transform.position, path.endPoint);
}
}