Blackboard selector doesnt move to second item

272799-2019-03-30-13-07-02-clipboard.png

Selector never goes to second item yet I am able to stop at the return Succeed whilst debugging.
If I reverse their order, ChooseNewWaypoint is hit once, then only MoveTo is being selected.

Values are properly updated by the code. I had similar issue when ChooseNewWaypoint with BP equivalent yet it started to work after some rearranging.

Code of the ChooseNewWaypoint

EBTNodeResult::Type UChooseNewWaypoint::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	auto aiController = OwnerComp.GetAIOwner();
	auto controlledPawn = aiController->GetPawn();
	auto patrollingGuard = Cast<AAI_PatrolGuard>(controlledPawn);
	auto patrolPoints = patrollingGuard->routePoints;

	auto blackBoardComponent = OwnerComp.GetBlackboardComponent();
	auto index = blackBoardComponent->GetValueAsInt(indexKey.SelectedKeyName);
	
	if (patrolPoints.Num() == 0)
	{
		return EBTNodeResult::Failed;
	}

	blackBoardComponent->SetValueAsObject(waypointKey.SelectedKeyName, patrolPoints[index]);

	auto nextIndex = (index + 1) % patrolPoints.Num();
	blackBoardComponent->SetValueAsInt(indexKey.SelectedKeyName, nextIndex);
	
	return EBTNodeResult::Succeeded;
}

My mistake. I replaced Selector with Sequence and everything started to work as expected.

Selector stops the order when first child in queue return Success. Sequence just do them in a row.