Hello!
I was trying to replace my old particle effects with Niagara effect system and the starting location and rotation of my muzzle effect, trace effect, and impact effect are now all going upward:
void ASWeapon::PlayFireEffects(FVector& StartLocation, FVector& TracerEndPoint)
{
if (FireEffectMuzzle)
{
UNiagaraComponent* NiagaraComp = UNiagaraFunctionLibrary::SpawnSystemAttached(FireEffectMuzzle, MeshComp, MuzzleSocketName, StartLocation, MeshComp->GetSocketRotation(MuzzleSocketName), EAttachLocation::Type::KeepRelativeOffset, true);
}
if (TraceEffect)
{
UNiagaraComponent* TracerEX = UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), TraceEffect, StartLocation);
if (TracerEX)
{
TracerEX->SetVectorParameter(TracerTargetName, TracerEndPoint);
}
}
if (SelectedEffect)
{
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), ImpactDefualt, Hit.ImpactPoint, Hit.ImpactNormal.Rotation());
}
APlayerController* PC = GetWorld()->GetFirstPlayerController();
if (PC)
{
PC->ClientStartCameraShake(FireCameraShakeClass);
}
}