fix: 玩家第一人称摄像机
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -14,3 +14,8 @@
|
|||||||
* @defgroup UI 用户界面系统
|
* @defgroup UI 用户界面系统
|
||||||
* 包含所有用户界面相关类。
|
* 包含所有用户界面相关类。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup UnitTest 单元测试
|
||||||
|
* 包含所有自动化单元测试类。
|
||||||
|
* /
|
||||||
|
|||||||
@@ -32,17 +32,9 @@ ASurviverPlayer::ASurviverPlayer() {
|
|||||||
// Set size for collision capsule
|
// Set size for collision capsule
|
||||||
GetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f);
|
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
|
// Create the Camera Component
|
||||||
CharacterCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("First Person Camera"));
|
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->
|
CharacterCameraComponent->
|
||||||
SetRelativeLocationAndRotation(FVector(-2.8f, 5.89f, 0.0f), FRotator(0.0f, 90.0f, -90.0f));
|
SetRelativeLocationAndRotation(FVector(-2.8f, 5.89f, 0.0f), FRotator(0.0f, 90.0f, -90.0f));
|
||||||
CharacterCameraComponent->bUsePawnControlRotation = true;
|
CharacterCameraComponent->bUsePawnControlRotation = true;
|
||||||
|
|||||||
@@ -22,10 +22,6 @@ UCLASS()
|
|||||||
class FIRSTPERSONDEMO_API ASurviverPlayer : public ACharacter, public IDamageableInterface {
|
class FIRSTPERSONDEMO_API ASurviverPlayer : public ACharacter, public IDamageableInterface {
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
// /** Pawn mesh: first person view */
|
|
||||||
// UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
|
||||||
// USkeletalMeshComponent* CharacterMesh;
|
|
||||||
|
|
||||||
/** First person camera */
|
/** First person camera */
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
||||||
UCameraComponent* CharacterCameraComponent;
|
UCameraComponent* CharacterCameraComponent;
|
||||||
|
|||||||
Reference in New Issue
Block a user