For the camera shake, Stephen called
GetWorld()->GetFirstPlayerController()->ClientStartCameraShake(HitCameraShakeClass);
I’m just curious why he chose that method over
UGameplayStatics::PlayWorldCameraShake(...args);
The particles and sounds are all using UGameplayStatics
methods. Why the change?
UGameplayStatics::ApplyDamage(OtherActor, Damage, MyOwnerInstigator, this, DamageeTypeClass);
if (HitParticles)
{
UGameplayStatics::SpawnEmitterAtLocation(this, HitParticles, GetActorLocation(), GetActorRotation());
}
if (HitSound)
{
UGameplayStatics::PlaySoundAtLocation(this, HitSound, GetActorLocation());
}
if (HitCameraShakeClass)
{
// This is the line in question
UGameplayStatics::PlayWorldCameraShake(this, HitCameraShakeClass, GetActorLocation(), 0.f, 5000.f);
// GetWorld()->GetFirstPlayerController()->ClientStartCameraShake(HitCameraShakeClass);
}