This page describes the actual behaviour of each enemy type.
- They all use
On Awake
toSetMovementForward
so they start moving in whichever direction they are facing. - Most of them (except the Maw Flower) use a
Selector
as their rootOn Fixed Update
node to pick a single successful action each frame. - The first node in that
Selector
isInvert
containingIsIdle
.- If the
Character
is in their Idle State,IsIdle
willPass
, then theInvert
will flip it toFail
so theSelector
will continue onto its next node. - If the
Character
is not in their Idle State,IsIdle
willFail
, then theInvert
will flip it toPass
so theSelector
will stop executing the rest of its children (since it "selected" a successful child).
- If the
- There are several other common node groups:
Sequence
:IsEnemyInFront
->TrySetState
allows theCharacter
to enter their Attack State when they see an enemy in front of them (the Player is the enemy of these monsters and the Gobbler is also hostile to the others because it's on a different Team).Sequence
:IsWallInFront
->TurnAround
allows theCharacter
to turn around when they run into a wall.Selector
:IsGroundInFront
->TurnAround
allows theCharacter
to turn around when they would walk off a ledge.
Gobbler
A weak monster which patrols back and forth between walls, walks off ledges, and is hostile everyone since it's on a different Team.
Gobbat
A flying monster which patrols back and forth between walls and uses SetMovementSine
to bob up and down as it goes.
Maw Flower
A plant monster which can't move and attacks periodically to either side. Unlike the other enemies, this one uses a Sequence
as its root On Fixed Update
node so that when it is in its Idle State it will wait a short time (2 loops of its Idle animation) then TrySetState
to attack in whichever direction it's facing and TurnAround
so that the next attack will be in the other direction.
Naga
A large snake monster which patrols back and forth on its platform. Its On Awake
node is a Sequence
to both SetMovementForward
and register a FaceAttacker
callback.
Scarecrow
A humanoid monster which patrols back and forth on its platform.