My NPC character uses an EventTick-driven state machine to fetch items and deliver them to a bowl. In the MOVING_TO_BOWL
and PICKING_UP
states, the branch conditions (checking IsMovingToBowl
/IsPickingUp
) fire both True and False outputs** almost simultaneously.
from my event tick i have multiple branches which each handle a specific task ( idle, searching for item, moving to item, picking up item, MOVING TO BOWL )
the search and moving item branches are executing as expected, but for the MOVING_TO_BOWLand
PICKING_UP, i start to notice that branch is firing both true and false. ( here is a simplify version of the node set up )
Event Tick
→ Switch on EFetcherState
→ Case: MOVING_TO_BOWL
→ Branch:
Condition = AND(
IsValid(BowlActor),
NOT(IsMovingToBowl),
NOT(bIsInTransition)
)
→ True:
→ print string "DEBUG: MOVING_TO_BOWL Branch - TRUE path taken!" --> call function start moving to bowl
→ False:
print string "DEBUG: MOVING_TO_BOWL Branch - FALSE path taken!" --> Ser current state to " idle "
StartMovingToBowl (Custom Event)
→ Set IsMovingToBowl = true // Start moving
→ IsValid(BowlActor)
→ True:
→ Print: “Moving to Bowl…”
→ AI MoveTo
- Pawn: Self
- Target: BowlActor
→ On Success:
→ Print: “Reached Bowl!”
→ Set CurrentState = DROPPING_OFF
→ Set IsMovingToBowl = false
→ Set bIsInTransition = false // UNLOCK
→ On Fail:
→ Print: “MoveTo failed!”
→ Set CurrentState = SEARCHING
→ Set IsMovingToBowl = false
→ Set bIsInTransition = false // UNLOCK
→ False:
→ Print: “Invalid Bowl!”
→ Set CurrentState = SEARCHING
→ Set IsMovingToBowl = false
→ Set bIsInTransition = false // UNLOCK
any idea what could be the issue here ?