parent
be63f6c7e3
commit
ba20d7588b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Characters/ChainDaddy/chaindaddy_Material_OcclusionRoughnessMetallic.uasset (Stored with Git LFS)
BIN
Content/Characters/ChainDaddy/chaindaddy_Material_OcclusionRoughnessMetallic.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,27 @@
|
||||
// Copyright Zelle Games
|
||||
|
||||
|
||||
#include "MoveToRandomSpot.h"
|
||||
|
||||
#include "AIController.h"
|
||||
#include "NavigationSystem.h"
|
||||
|
||||
EBTNodeResult::Type UMoveToRandomSpot::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
|
||||
{
|
||||
bNotifyTick = 1;
|
||||
FNavLocation Loc;
|
||||
UNavigationSystemV1* NavSystem = UNavigationSystemV1::GetCurrent(GetWorld());
|
||||
NavSystem->GetRandomReachablePointInRadius(OwnerComp.GetAIOwner()->GetPawn()->GetActorLocation(), 8000, Loc);
|
||||
OwnerComp.GetAIOwner()->MoveToLocation(Loc.Location);
|
||||
return EBTNodeResult::InProgress;
|
||||
}
|
||||
|
||||
void UMoveToRandomSpot::TickTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
|
||||
{
|
||||
TimeSinceExecute += DeltaSeconds;
|
||||
if(TimeSinceExecute > 2)
|
||||
{
|
||||
FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
// Copyright Zelle Games
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BehaviorTree/BTTaskNode.h"
|
||||
#include "MoveToRandomSpot.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class STREETPUNKZ_API UMoveToRandomSpot : public UBTTaskNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override;
|
||||
virtual void TickTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;
|
||||
float TimeSinceExecute;
|
||||
};
|
Loading…
Reference in new issue