ScriptableObjects
Last updated
Last updated
Create a new scene
Create a new GameObject called Goap
, add the GoapRunnerBehaviour
to it.
Create a folder called Configs
.
Within the Configs
folder create a folder called TargetKeys
. Within this folder press right click Create > GOAP > Target Key Config
. Call the config WanderTarget
.
Within the Configs
folder create a folder called WorldKeys
. Within this folder press right click Create > GOAP > World Key Config
. Call the config IsWandering
.
Within the Configs
folder create a folder called Goals
. Within this folder press right click Create > GOAP > Goal Config
. Call the config WanderGoal
.
Select the WanderGoal
script in the class
property.
Add a condition to the conditions
property. Set the key
to IsWandering
, the comparison
to GreaterThanOrEqual
and the value
to 1
.
Within the Configs
folder create a folder called Actions
. Within this folder press right click Create > GOAP > Action Config
. Call the config WanderAction
.
Select the WanderAction
script in the class
property.
Set the target
to WanderTarget
.
Add an effect to the effects
property. Set the key
to IsWandering
, the increase
to true
.
Within the Configs
folder create a folder called TargetSensors
. Within this folder press right click Create > GOAP > Target Sensor Config
. Call the config WanderTargetSensor
.
Select the WanderTargetSensor
script in the class
property.
Set the key
to WanderTarget
.
Within the Configs
folder create a folder called Sets
. Within this folder press right click Create > GOAP > Goap Set Config
. Call the config GettingStartedSet
.
Add the WanderGoal
config to the goals
property.
Add the WanderAction
config to the actions
property.
Add the WanderTargetSensor
config to the targetSensors
property.
In the scene, add a GameObject called GoapSet
. Add the GoapSetBehaviour
to it.
In the Config
property of the GoapSetBehaviour
select the GettingStartedSet
config.
In the Runner
property of the GoapSetBehaviour
select the Goap
GameObject.
Create a sphere GameObject
called Agent
. Add the AgentBehaviour
, AgentMoveBehaviour
and AgentBrain
to the GameObject
.
In the GoapSetConfig
property of the AgentBehaviour
select the GoapSet
GameObject.
Run the scene. The agent should move around randomly.