Using the GoToAction as an example.

Name: The name of the action that appears in the planner and debugger


The planner use this value to rank and pick a set of actions that is the cheapest.

Default: The number here is a static value that is used by the planner to prioritize which action is cheaper to execute.

Evaluator: A cost evaluator can be placed here, allowing you to dynamically set the cost at runtime achieving Fuizziness AI. A new class need to inherit CostEvaluator.

public class FooCostEvaluator : CostEvaluator
    public override float Evaluate(IContext context)
      return Random.Range(0,15);

Usable Evaluator

This is called at the very beginning of the plan, so if this returns false, it won't even be considered part of the plan. An action may not be usable if it is not ready. Such as a charged attack will need to be 'fully charged' and this is often easier to be done via code. Wand.IsFullyCharged.

Default: Uses the cooldown by default and let your code handles most of it. Evaluator: Very similar to CostEvaluator, this allows you to dynamically and reuse evaluators, such as the WithinRangeEvaluator component.

public class Foo : UsableEvaluator
  public override bool Evaluate(IContext context)
    return PlayerIsWithinRange;


When adding or removing a state to an agent, the most important thing to consider is the condition.

Below are the conditions and what they mean.






A precondition is a state at which the GOAP Planner expects to be true before it puts the action in the plan. In the example above, there are two preconditions to start the action.