Initial Project Setup
This commit is contained in:
36
Source/MyProject3/CameraFollowActor.h
Normal file
36
Source/MyProject3/CameraFollowActor.h
Normal file
@@ -0,0 +1,36 @@
|
||||
// CameraFollowActor.h
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "CameraFollowActor.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class YOURPROJECT_API ACameraFollowActor : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ACameraFollowActor();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
// The target actor that the camera will follow
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera")
|
||||
AActor* TargetActor;
|
||||
|
||||
// The offset from the target actor
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera")
|
||||
FVector CameraOffset;
|
||||
|
||||
private:
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UCameraComponent* CameraComponent;
|
||||
};
|
||||
Reference in New Issue
Block a user