9#include "CoreMinimal.h"
10#include "Components/ActorComponent.h"
11#include "UOrbitalBehaviorComponent.generated.h"
18UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
19class COFFEELIBRARY_API UOrbitalBehaviorComponent :
public UActorComponent
25 UOrbitalBehaviorComponent();
28 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Follow", meta=(ClampMin="0.0"))
29 float AnchorLerpSpeed = 3.f;
32 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Follow")
33 bool bUseConstantFollow = false;
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Follow", meta=(EditCondition="bUseConstantFollow", ClampMin="0.0"))
37 float AnchorFollowUnitsPerSec = 800.f;
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Targets")
41 AActor* TargetActor =
nullptr;
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Targets")
45 AActor* PlayerActor =
nullptr;
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Orbit", meta=(ClampMin="0.0"))
49 float OrbitRadius = 200.f;
52 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Orbit")
53 float HeightOffset = 0.f;
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Orbit")
57 float IdleYawSpeedDegPerSec = 90.f;
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Vertical")
61 float BobAmplitude = 30.f;
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Vertical", meta=(ClampMin="0.0"))
65 float BobSpeed = 1.2f;
68 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Movement")
69 bool bSweepMovement = false;
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Target Float|Rotation")
73 bool bFacePlayer = true;
76 UFUNCTION(BlueprintCallable, Category="Target Float|Follow")
77 void SetTargetActor(AActor* NewTarget,
bool bSnapAnchor = false,
bool bPreserveOrbitPhase = true);
81 virtual
void BeginPlay() override;
83 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
89 FVector AnchorLoc = FVector::ZeroVector;
92 void Tick_TargetFloat(
float DeltaTime);