GOAP
GOAP v3
GOAP v3
  • Introduction
    • What is Goap?
    • Tutorial
      • 1. Getting Started
      • 2. Idle
      • 3. Pears
    • FAQ
  • Upgrading
    • V3.0 Changes
    • V3.0 Upgrade guide
    • V2.1 Upgrade guide
  • Config
    • Through ScriptableObjects
    • Through Code
  • Classes
    • Goals
    • Actions
    • AgentBehaviour and ActionProvider
    • Sensors
    • TargetKeys
    • WorldKeys
  • General
    • AgentType & Capabilities
    • Controllers
    • Generator
    • WorldState
    • Conditions & Effects
    • Data Injection
    • Life Cycles
    • GraphViewer
  • Examples
    • Simple
    • Complex
Powered by GitBook
On this page
  • Creating a WorldKey
  • Using ScriptableObject:
  • Using Code:
Edit on GitHub
  1. Classes

WorldKeys

WorldKeys are important in the GOAP system. They point to specific things or situations in the game. The Planner uses these keys to decide what Action an agent should do next.

Each WorldKey is connected to a WorldSensor. This sensor checks and gives the current value for its WorldKey. So, the WorldKey tells us what to look for, and the WorldSensor tells us the current value of that thing in the game.

Creating a WorldKey

Using ScriptableObject:

  1. In the Unity editor, right-click on the folder you want.

  2. Go to Create > Goap > WorldKey to make a new WorldKey.

Using Code:

You can also make a new WorldKey by writing a class that uses the WorldKeyBase class.

Example:

IsHungry.cs
using CrashKonijn.Goap.Behaviours;

public class IsHungry : WorldKeyBase
{
}
PreviousTargetKeysNextGeneral

Last updated 10 months ago