fix: 玩家第一人称摄像机
This commit is contained in:
@@ -13,4 +13,9 @@
|
||||
/**
|
||||
* @defgroup UI 用户界面系统
|
||||
* 包含所有用户界面相关类。
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup UnitTest 单元测试
|
||||
* 包含所有自动化单元测试类。
|
||||
* /
|
||||
|
||||
@@ -32,17 +32,9 @@ ASurviverPlayer::ASurviverPlayer() {
|
||||
// Set size for collision capsule
|
||||
GetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f);
|
||||
|
||||
// Create the first person mesh that will be viewed only by this character's owner
|
||||
// CharacterMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("角色 Mesh"));
|
||||
// CharacterMesh->SetupAttachment(GetMesh());
|
||||
// CharacterMesh->SetOnlyOwnerSee(true);
|
||||
// CharacterMesh->FirstPersonPrimitiveType = EFirstPersonPrimitiveType::FirstPerson;
|
||||
// CharacterMesh->SetCollisionProfileName(FName("NoCollision"));
|
||||
|
||||
// Create the Camera Component
|
||||
CharacterCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("First Person Camera"));
|
||||
// CharacterCameraComponent->SetupAttachment(CharacterMesh, FName("head"));
|
||||
// CharacterCameraComponent->SetupAttachment(this->GetMesh(), FName("head"));
|
||||
CharacterCameraComponent->SetupAttachment(this->GetMesh(), FName("head"));
|
||||
CharacterCameraComponent->
|
||||
SetRelativeLocationAndRotation(FVector(-2.8f, 5.89f, 0.0f), FRotator(0.0f, 90.0f, -90.0f));
|
||||
CharacterCameraComponent->bUsePawnControlRotation = true;
|
||||
|
||||
@@ -22,10 +22,6 @@ UCLASS()
|
||||
class FIRSTPERSONDEMO_API ASurviverPlayer : public ACharacter, public IDamageableInterface {
|
||||
GENERATED_BODY()
|
||||
|
||||
// /** Pawn mesh: first person view */
|
||||
// UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
||||
// USkeletalMeshComponent* CharacterMesh;
|
||||
|
||||
/** First person camera */
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
||||
UCameraComponent* CharacterCameraComponent;
|
||||
|
||||
Reference in New Issue
Block a user