void ANimModCharacter::PostInitializeComponents() { Super::PostInitializeComponents(); if (Role == ROLE_Authority) { Health = GetMaxHealth(); SpawnDefaultInventory(); } // set initial mesh visibility (3rd person view) UpdatePawnMeshes(); // create material instance for setting team colors (3rd person view) for (int32 iMat = 0; iMat < GetMesh()->GetNumMaterials(); iMat++) { MeshMIDs.Add(GetMesh()->CreateAndSetMaterialInstanceDynamic(iMat)); } // play respawn effects if (GetNetMode() != NM_DedicatedServer) { if (RespawnFX) { UGameplayStatics::SpawnEmitterAtLocation(this, RespawnFX, GetActorLocation(), GetActorRotation()); } if (RespawnSound) { UGameplayStatics::PlaySoundAtLocation(this, RespawnSound, GetActorLocation()); } } }
void AShooterCharacter::PostInitializeComponents() { Super::PostInitializeComponents(); if (Role == ROLE_Authority) { SpawnDefaultInventory(); } }
void ASCharacter::PostInitializeComponents() { Super::PostInitializeComponents(); if (Role == ROLE_Authority) { // Set a timer to increment hunger every interval FTimerHandle Handle; GetWorldTimerManager().SetTimer(Handle, this, &ASCharacter::IncrementHunger, IncrementHungerInterval, true); SpawnDefaultInventory(); } }
void ANimModCharacter::SetPlayerDefaults() { DestroyInventory(); SpawnDefaultInventory(); }
void ASGameMode::SetPlayerDefaults(APawn* PlayerPawn) { Super::SetPlayerDefaults(PlayerPawn); SpawnDefaultInventory(PlayerPawn); }
void ALonelyMenCharacter::PostInitializeComponents() { Super::PostInitializeComponents(); SpawnDefaultInventory(); }