Download

BehaviorTree MoveTo Task Node randomly Failling

So when i ported my game to the 4.7.3 I Noticed the MoveTo task node on my Behavior Tree would start to randomly fail, most of the times i tested it would fail, very rarely it would actually work as intended, Randomly it would just fail out Halfway trough the move or as soon it began, others it failed as soon it was complete This behavior wasnt present on the 4.6 Build i searched trough the answerhub and found that other users are also having the same trouble . Sadly none of the present solutions worked for me like Projecting the point the AI Bot should move to and use that for the MoveTo task

I also posted on the answerhub but i dident got an answer there either

Here is pic of my behavior tree if it helps…

Bump…With the 4.7.4 Hotfix moving to a Actor works great but it still seems to randomly fail when using a vector

Have you rebuilt the navmesh out of interest? if you press Ctrl-P does the navmesh look right for the scene? Can you watch the actor that is doing the move and spot where it fails?

Yeah i have reubuilt the navmesh, also im using dynamic navmesh generation on runtime so no worries about that, After taking a closer look i saw that the MoveTo node fails as soon its executed always, the second time its executed it does work as it should, but Since it fails the 1st time it breaks up all my logic since the tree moves into my other selectors etc

I made a video to show the behavior with a simplified tree

The 1st node just gets the reference to the Tavern and assigns that as a blackboard, here is the relevant code



EBTNodeResult::Type UTTBTTask_MoveToTheTavern::ExecuteTask(class UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	UBehaviorTreeComponent* MyComp = &OwnerComp;
	ATTCustomerAIController* MyController = MyComp ? Cast<ATTCustomerAIController>(OwnerComp.GetOwner()) : NULL;

	if (MyController == NULL)
	{
		return EBTNodeResult::Failed;
	}

	else
	{
		for (TActorIterator<ATTRoom> ActorItr(GetWorld()); ActorItr; ++ActorItr)
		{
			if (ActorItr)
			{
				FVector Destination = ActorItr->GetActorLocation(); // get the tavern location
				ATTRoom* Room = Cast<ATTRoom>(*ActorItr);
				if (ActorItr->bIsSpawnRoom)
				{
                                 OwnerComp.GetBlackboardComponent()->SetValue<UBlackboardKeyType_Object>("CurrentRoom", Room);
				 return EBTNodeResult::Succeeded;
				 break;
			        }
			}		
		}
	}
	return EBTNodeResult::Failed;
}