Issue: Branch Executing Both True & False Paths

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_BOWLandPICKING_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 ?

Welcome to the Forums. I have to admit, I’m slightly struggling to follow your logic but it would seem that this being on tick is the problem.

From what I can tell when you start AIMoveTo in the StartMovingToBowl function you must be setting bIsMovingToBowl to true which would make the next tick jump to the False path of that branch which would set the CurrentState enum back to Idle which would then make the switch go back to idle which would reset the bIsMovingToBowl and that would continue around and around in a circle breaking your logic. They aren’t firing at the same time but on tick they are happening fast enough that it appears that way that’s why all those execution paths are highlighted.

Not being able to see all your logic I can’t say for sure but from what I can tell this should not need to be running on tick (The times when you need to run anything gameplay wise on tick rounded to the nearest whole number is 0, if you need repeating behaviour use timers). Functions like AIMoveTo are letent (denoted by the little clock in the top right corner) this means they happen over time anyway so if you call it again while it’s still running it will not work right.

Again I may be missing some info here and am giving you incorrect information but I am pretty confident that is the problem.