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);
51 UFUNCTION(BlueprintCallable)
52 void TeleportToFollowLocation(FVector TargetLocation,
const float DistanceToLocation,
const float HeightOffset);
57 UFUNCTION(BlueprintCallable)
58 void TeleportToActorFollowLocation(AActor* Actor,
const float DistanceToActor = 1500.0f,
const float HeightOffset = 500.0f);
64 UFUNCTION(BlueprintCallable)
65 void StopFollowingAnyActor(
bool EnableInputs =
true);
71 UFUNCTION(BlueprintCallable)
72 void SetNiagaraComponentVisibility(
bool Visible);
77 UFUNCTION(BlueprintCallable)
78 void SetMaxSpeed(
float MaxSpeed = 1500.0f);
83 UFUNCTION(BlueprintCallable)
90 UFUNCTION(BlueprintCallable)
91 AActor* GetTargetActor()
99 UFUNCTION(BlueprintCallable)
100 bool IsNiagaraComponentVisible()
102 if (NiagaraComponent)
104 return NiagaraComponent->IsVisible();
114 UFUNCTION(BlueprintCallable)
115 bool IsSpectatorFollowingAnyActor()
117 return GetTargetActor() !=
nullptr;
124 UFUNCTION(BlueprintCallable)
125 UFloatingPawnMovement* GetFloatingPawnMovement();
131 UFUNCTION(BlueprintCallable)
137 UPROPERTY(BlueprintAssignable)
138 FFollowTargetChanged OnFollowTargetChanged;
142 virtual
void BeginPlay() override;
144 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
146 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
147 UNiagaraComponent* NiagaraComponent =
nullptr;
151 TWeakObjectPtr<AActor> Target;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FFollowTargetChanged, bool, IsFollowing, AActor *, TargetActor)