Spawn emitter from particle system in assets?
How do I go about linking this asset to making it spawn in my game for a period of time without using Blueprints?
You can use the method in UGameplayStatics called SpawnEmitterAtLocation to spawn a particle system. There's plenty examples of other systems doing that in the code if you need more help.
I know about that method. All the other particle systems in code are in things like explosions, which are called after firing a grenade like weapon. I can't call the particle system directly. How do I create a new particle system in code and map an already created particle system in assets to it?
Hmm, I don't quite understand. What do you mean you can't call the particle system directly and want to map one particle system over another?
You might be able to use something like a Redirector, although that seems a bit scary. I'd just have it use whatever particle system you want instead. If you know the path of the asset you want to use, you can use FStringAssetReference with it's TryLoad() method to load the particle at runtime.
I'm sorry I'll try to be as clear as possible.
However it never executes inside the if statement. Am I right in assuming RespawnFX is somehow null? If so, does that mean a particle system is not properly attached to it? Also how would I go about attaching an effect to the particle system RespawnFX? Thank you.
Respawn FX is likely null if you aren't seeing anything. You can place a breakpoint and verify. Your code would require a designer or someone is setting that value in the Unreal Editor and then saving it.
What do you mean "attaching an effect"? Do you want to attach another particle to this one you are trying to spawn? Or do you want the RespawnFX attached to some object?
I might be using the wrong terms as I am new to Unreal Engine. I want RespawnFX to be assigned the bazooka effect that I have in my assets. I hope that in doing this then RespawnFX would no longer be null and upon respawn a bazooka effect would play.
Ah, Gotcha. You need to set RespawnFX somehow. Normally you do that through the editor. I assume you have a ShooterCharacter somewhere in your level? Click on it, find the RespawnFX field, and point it to the Bazooka Particle System. Then save and run your game.
Thank you so much! Remapping it worked. I've done so much research on getting this to work.
How to connect a beam emitter from spawned projectile to the player?
Is it possible to create effect just by coding? with no particle systems or anything else just by coding.