Comment on page
ScriptableObjects
- 1.Create a new scene
- 2.Create a new GameObject called
Goap
, add theGoapRunnerBehaviour
to it.

Goap Runner Behaviour
- 3.Create a folder called
Configs
. - 4.Within the
Configs
folder create a folder calledTargetKeys
. Within this folder press right clickCreate > GOAP > Target Key Config
. Call the configWanderTarget
. - 5.Within the
Configs
folder create a folder calledWorldKeys
. Within this folder press right clickCreate > GOAP > World Key Config
. Call the configIsWandering
. - 6.Within the
Configs
folder create a folder calledGoals
. Within this folder press right clickCreate > GOAP > Goal Config
. Call the configWanderGoal
.- 1.Select the
WanderGoal
script in theclass
property. - 2.Add a condition to the
conditions
property. Set thekey
toIsWandering
, thecomparison
toGreaterThanOrEqual
and thevalue
to1
.

Wander Goal
- 7.Within the
Configs
folder create a folder calledActions
. Within this folder press right clickCreate > GOAP > Action Config
. Call the configWanderAction
.- 1.Select the
WanderAction
script in theclass
property. - 2.Set the
target
toWanderTarget
. - 3.Add an effect to the
effects
property. Set thekey
toIsWandering
, theincrease
totrue
.

Wander Action
- 8.Within the
Configs
folder create a folder calledTargetSensors
. Within this folder press right clickCreate > GOAP > Target Sensor Config
. Call the configWanderTargetSensor
.- 1.Select the
WanderTargetSensor
script in theclass
property. - 2.Set the
key
toWanderTarget
.

Wander Target Sensor
- 9.Within the
Configs
folder create a folder calledSets
. Within this folder press right clickCreate > GOAP > Goap Set Config
. Call the configGettingStartedSet
.- 1.Add the
WanderGoal
config to thegoals
property. - 2.Add the
WanderAction
config to theactions
property. - 3.Add the
WanderTargetSensor
config to thetargetSensors
property.

Getting Started Set
- 10.In the scene, add a GameObject called
GoapSet
. Add theGoapSetBehaviour
to it.- 1.In the
Config
property of theGoapSetBehaviour
select theGettingStartedSet
config. - 2.In the
Runner
property of theGoapSetBehaviour
select theGoap
GameObject.

Goap Set
- 11.Create a sphere
GameObject
calledAgent
. Add theAgentBehaviour
,AgentMoveBehaviour
andAgentBrain
to theGameObject
.- 1.In the
GoapSetConfig
property of theAgentBehaviour
select theGoapSet
GameObject.

Agent
- 12.Run the scene. The agent should move around randomly.
Last modified 7mo ago