Add `"Player"` Actor Tag to PlayerCharacter
This commit is contained in:
parent
19a5054271
commit
26d9daf73d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue