How do I attach a particle system to a character class through code?
Hi! I would like to know if there's a way to attach a particle system in a character class I've created, I tried with
It didn't work. I hope someone has the patience to enlight me. Thanks
You want GameplayStatics!
See GameplayStatics.h for more info!
ake sure to include:
I found a couple ways:
You can use
.cpp (this code goes in the constructor)
In order to get the path to your particle system you need to open the editor, right click the particle system in the content browser and choose
Now you need to attach your particle system to a scene component. I found it's best to do this in
The above attaches to a static mesh component, but of course you want to attach to whatever component you need.
Now just call ActivateSystem or DeactivateSystem whenever.
his doesn't involve as much code, but requires you to set the particle system in your blueprint.
If you want your particle system to be attached you would use:
Again, attaching to a static mesh component. I haven't really found a better way of getting components so I don't know what your results will be if you have more than one type of component, ie. two static meshes, in your hierarchy.
answered May 28 '14 at 12:11 AM
Thanks, I'll try them to see which one is the best, many thanks!!!!! (Y)
answered May 28 '14 at 11:55 PM
Wow, thanks, I'll study them to see which one is the best way to attach the particle system, thank you so much!!! (Y)
answered May 28 '14 at 11:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here