Add `"Player"` Actor Tag to PlayerCharacter

This commit is contained in:
Louis Hobbs 2023-01-16 23:13:24 +00:00
parent 19a5054271
commit 26d9daf73d
1 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,8 @@ APlayerCharacter::APlayerCharacter()
UCharacterMovementComponent* CharacterMovementComponent = GetCharacterMovement(); UCharacterMovementComponent* CharacterMovementComponent = GetCharacterMovement();
CharacterMovementComponent->AirControl = 1.0f; CharacterMovementComponent->AirControl = 1.0f;
CharacterMovementComponent->bOrientRotationToMovement = true; CharacterMovementComponent->bOrientRotationToMovement = true;
this->Tags.Add(FName("Player"));
} }
// Called when the game starts or when spawned // Called when the game starts or when spawned
@ -52,6 +54,12 @@ void APlayerCharacter::BeginPlay()
DefaultMovementSpeed = GetCharacterMovement()->MaxWalkSpeed; DefaultMovementSpeed = GetCharacterMovement()->MaxWalkSpeed;
SetInventoryToDefault(); SetInventoryToDefault();
if (!this->ActorHasTag(FName("Player")))
{
this->Tags.Add(FName("Player"));
}
} }
// Called every frame // Called every frame