void UBTDecorator_TimeLimit::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) { OwnerComp.RequestExecution(this); // make sure that next tick won't happen before execution request is processed SetNextTickTime(NodeMemory, 1000000.0f); }
void UBTService::TickNode(UBehaviorTreeComponent* OwnerComp, uint8* NodeMemory, float DeltaSeconds) { const float NextTickTime = FMath::FRandRange(FMath::Max(0.0f, Interval - RandomDeviation), (Interval + RandomDeviation)); SetNextTickTime(NodeMemory, NextTickTime); }