Dear Friends at Epic,
I need to do the following
- spawn a particle using gameplaystatics spawn at location
- manually attach this PSC to a Character’s Mesh
I cannot use gameplay statics spawnattached, because I am using vertex locations, not bone or sockets.
So I need to spawn the PSC in world space, and then attach it to the character mesh, keeping relative offset.
I see in shootergame example that a PSC is created and added to the components of the pickup actor, but I am doing this during game time and the number of PSCs is very very large.
#What Works
The PSCs spawn at the correct locations in world space, but they do not become attached and move with the character.
#My Attach PSC To Mesh Function
Here’s what I’ve tried so far:
void AVictoryPlayerCharacterBase::AttachPSCToMesh(UParticleSystemComponent* ThePSC)
{
if(!ThePSC) return;
//~~~~~~~~~~
ThePSC->SetMobility(EComponentMobility::Movable);
ThePSC->AttachTo(Mesh);
ThePSC->AttachParent = Mesh;
}
#Goal
How can I spawn in world space and then attach a PSC to a Character Mesh, keeping relative offsets?
Thanks!
Rama