Hi! I am trying to make my particle system match the main material of my parent component. (Basically I have a particle effect of my entities falling to bits on death, and I want the material to match no matter what the entity is).
I have managed to cobble together some code which compiles fine, but the particle effect keeps the default material, rather than the material of the parent.
This is the code in question:
if (DeathFX)
{
UParticleSystemComponent* SpawnedFX = UGameplayStatics::SpawnEmitterAtLocation(this, DeathFX, GetActorLocation(), GetActorRotation());
if (DynaMats[0])
SpawnedFX->SetMaterial(1,DynaMats[0]);
}
I can confirm my array has the right reference to the parent actor’s material. I guess I am doing something wrong with how I am making my reference to the particle system in question perhaps? I’m a bit rusty.