In the class Character we have this method PostInitializeComponents
void ACharacter::PostInitializeComponents()
{
Super::PostInitializeComponents();
if (!IsPendingKill())
{
if (Mesh)
{
BaseTranslationOffset = Mesh->RelativeLocation;
BaseRotationOffset = Mesh->RelativeRotation.Quaternion();
// force animation tick after movement component updates
if (Mesh->PrimaryComponentTick.bCanEverTick && CharacterMovement)
{
Mesh->PrimaryComponentTick.AddPrerequisite(CharacterMovement, CharacterMovement->PrimaryComponentTick);
}
}
if (CharacterMovement && CapsuleComponent)
{
CharacterMovement->UpdateNavAgent(*CapsuleComponent);
}
if (Controller == NULL && GetNetMode() != NM_Client)
{
if (CharacterMovement && CharacterMovement->bRunPhysicsWithNoController)
{
CharacterMovement->SetDefaultMovementMode();
}
}
}
}
The question is why the Mesh need register the PrimaryComponentTick of CharacterMovementComponent?
Mesh->PrimaryComponentTick.AddPrerequisite(CharacterMovement, CharacterMovement->PrimaryComponentTick);
Thanks in Advance