fixed camera attachment

This commit is contained in:
2025-11-28 22:27:57 -05:00
parent f46b65df11
commit 4b856b1d24
4 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@@ -11,7 +11,11 @@ ADDICharacter::ADDICharacter()
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
// bReplicateMovement = true;
CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraComponent"));
CameraComponent->SetupAttachment(GetMesh(), "headSocket");
CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f));
CameraComponent->bUsePawnControlRotation = true;
}

View File

@@ -26,6 +26,6 @@ public:
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera")
UCameraComponent* CameraComponent
UCameraComponent* CameraComponent;
};