8#include "CoreMinimal.h"
9#include "GameFramework/DefaultPawn.h"
10#include "NiagaraComponent.h"
13#include "Spectator.generated.h"
17class UFloatingPawnMovement;
32 UFUNCTION(BlueprintCallable)
33 void TeleportSpectator(
const FTransform&
Transform);
38 UFUNCTION(BlueprintCallable)
39 void TeleportToActorLocation(
const AActor* Actor);
44 UFUNCTION(BlueprintCallable)
45 void FollowActor(AActor* Actor,
bool DisableInputs =
true,
const float DistanceToActor = 150.0f,
const float HeightOffset = 10.0f);
50 UFUNCTION(BlueprintCallable)
51 void TeleportToActorFollowLocation(AActor* Actor,
const float DistanceToActor = 1500.0f,
const float HeightOffset = 500.0f);
57 UFUNCTION(BlueprintCallable)
58 void StopFollowingAnyActor(
bool EnableInputs =
true);
64 UFUNCTION(BlueprintCallable)
65 void SetNiagaraComponentVisibility(
bool Visible);
70 UFUNCTION(BlueprintCallable)
71 void SetMaxSpeed(
float MaxSpeed = 1500.0f);
76 UFUNCTION(BlueprintCallable)
83 UFUNCTION(BlueprintCallable)
84 AActor* GetTargetActor()
92 UFUNCTION(BlueprintCallable)
93 bool IsNiagaraComponentVisible()
97 return NiagaraComponent->IsVisible();
107 UFUNCTION(BlueprintCallable)
108 bool IsSpectatorFollowingAnyActor()
110 return GetTargetActor() !=
nullptr;
117 UFUNCTION(BlueprintCallable)
118 UFloatingPawnMovement* GetFloatingPawnMovement();
124 UFUNCTION(BlueprintCallable)
130 UPROPERTY(BlueprintAssignable)
131 FFollowTargetChanged OnFollowTargetChanged;
135 virtual
void BeginPlay() override;
137 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
139 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
140 UNiagaraComponent* NiagaraComponent =
nullptr;
144 TWeakObjectPtr<AActor> Target;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FFollowTargetChanged, bool, IsFollowing, AActor *, TargetActor)