8#include "CoreMinimal.h"
9#include "GameFramework/DefaultPawn.h"
10#include "NiagaraComponent.h"
13#include "Spectator.generated.h"
19class UFloatingPawnMovement;
34 UFUNCTION(BlueprintCallable)
35 void TeleportSpectator(
const FTransform&
Transform);
40 UFUNCTION(BlueprintCallable)
41 void TeleportToActorLocation(
const AActor* Actor);
46 UFUNCTION(BlueprintCallable)
47 void FollowActor(AActor* Actor,
bool DisableInputs =
true,
const float DistanceToActor = 150.0f,
const float HeightOffset = 10.0f);
53 UFUNCTION(BlueprintCallable)
54 void TeleportToFollowLocation(FVector TargetLocation,
const float DistanceToLocation,
const float HeightOffset);
59 UFUNCTION(BlueprintCallable)
60 void TeleportToActorFollowLocation(AActor* Actor,
const float DistanceToActor = 1500.0f,
const float HeightOffset = 500.0f);
66 UFUNCTION(BlueprintCallable)
67 void StopFollowingAnyActor(
bool EnableInputs =
true);
73 UFUNCTION(BlueprintCallable)
74 void SetNiagaraComponentVisibility(
bool Visible);
79 UFUNCTION(BlueprintCallable)
80 void SetMaxSpeed(
float MaxSpeed = 1500.0f);
85 UFUNCTION(BlueprintCallable)
92 UFUNCTION(BlueprintCallable)
93 AActor* GetTargetActor()
101 UFUNCTION(BlueprintCallable)
102 bool IsNiagaraComponentVisible()
104 if (NiagaraComponent)
106 return NiagaraComponent->IsVisible();
116 UFUNCTION(BlueprintCallable)
117 bool IsSpectatorFollowingAnyActor()
119 return GetTargetActor() !=
nullptr;
122 UFUNCTION(BlueprintCallable)
125 return OverlapSensor;
132 UFUNCTION(BlueprintCallable)
133 UFloatingPawnMovement* GetFloatingPawnMovement();
139 UFUNCTION(BlueprintCallable)
145 UPROPERTY(BlueprintAssignable)
146 FFollowTargetChanged OnFollowTargetChanged;
150 virtual
void BeginPlay() override;
152 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
154 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
155 UNiagaraComponent* NiagaraComponent =
nullptr;
157 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
162 TWeakObjectPtr<AActor> Target;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FFollowTargetChanged, bool, IsFollowing, AActor *, TargetActor)