Hi there!
In my project, I’ve got a base c++ class for a weapon, in which at a certain point I spawn a niagara particle system for a bullet casing. On one weapon, the performance impact for spawning this particle system is almost unnoticeable. However, on another weapon derived from the same base class, the game dips an insane amount, with World Tick Time
taking up a crazy amount of resources, as demonstrated in the video below.
The code that spawns the particle system looks like this:
UNiagaraFunctionLibrary::SpawnSystemAttached(EjectedCasing, MagazineAttachment, FName("ejection_port"), FVector::ZeroVector, EjectionSpawnVector, EAttachLocation::SnapToTarget, true, true);
If you’d like to look more in depth, the whole file is here (the above code is found at like 382): isolation-game/SWeaponBase.cpp at main · whoisEllie/isolation-game · GitHub
Below are screenshots of my particle system and the two weapons.
I’m honestly really confused as to what it could be, and I’d appreciate any help,
Thanks,
- Ellie