Issue - Putting the Particle Emitter P_Explosion in Launch Blast Component Does not work

I Have followed Ben’s instructions when putting the particle emitter (P_Explosion) in the “Launch Blast’s Particle Template”

To make sure that i have migrated successfully i tried to put the particle into world by dragging in into the level. and every time i would start the level the particle plays out well.

But when i put it in the Launch Blast component nothing happens.

I even opened the particle and it plays well inside the particle editor.

I also have “Real-Time Rendering” ticked on in the Viewport.

Does it have an issue because im using 4.16? There an error saying that “AttachTo” function is outdated.:

CompilerResultsLog:Error: Error C:\Udemy\04_BattleTank\BattleTank\Source\BattleTank\Private\Projectile.cpp(24) : warning C4996: ‘USceneComponent::AttachTo’: This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
CompilerResultsLog:Error: Error C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Engine\Classes\Components/SceneComponent.h(615) : note: see declaration of ‘USceneComponent::AttachTo’

Here is a screenie of my Projectile BP. My Collision Mesh Component works because i can add mesh to it and texture and it is reflected to the game.

Here is my Projectile cpp and header file. I think i followed Ben’s instruction well But i included it here maybe i did something wrong.

Here is P_Explosion Particle which works well

And my output log after compiling just in case

@martopad Did you find the solution to this? I’m having the same issue with engine version 4.14.3 right now.

@CommittedGamer nope man after a few days of no reply i just watched the rest of the battletanks chapter without trying it out.

@martopad Alright thanks for replying. I tried a few different approaches too in 4.14.3 and didn’t get the particle effects to work.

Good Luck! If you happen to solve it feel free to post the solution here! :slight_smile:

I did get this to work eventually, the fix required:

  1. Updating the code to use AttachToComponent (which I’d done before posting here)
  2. Lots of editor restarts to break caching (I’d done a couple before posting here)

Unreal was very aggressively caching my code and even after the above steps the particle system wasn’t working for hours. I continued with the course yesterday and then the particles magically started to work!

Great! Thanks for posting the solution!

Maybe ill try it sometime.

Worked for me too.

LaunchBlast->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);

I started with Ben’s “LaunchBlast->AttachTo(RootComponent);” but no particles :frowning:

Changed to …AttachToComponent(… and re-compiled - still :frowning:

Commented out creating and attaching the particle system (LaunchBlast).
Recompliled…
Uncommented creating and attaching the particle system
Recompiled and voila particles :slight_smile:

3 Likes

Commented out creating and attaching the particle system (LaunchBlast).
Recompliled…
Uncommented creating and attaching the particle system
Recompiled and voila particles :slight_smile:

Just to add some weight to this. This workaround also resolved the issue for me.

Literally added this code and the problem was solved.

LaunchBlast = CreateDefaultSubobject<UParticleSystemComponent>(FName("Launch Blast"));
LaunchBlast->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
LaunchBlast->bAutoActivate = true;

Hope it helps.

Adding more weight to this

Also worked for me
Thank you!

In case anyone else, like me, tried all the above and it still didn’t work you can try this…

If you’re getting a warning in your output log regarding the projectile that says something like

“Projectile_0 has natively added scene component(s), but none of them were set as the actor’s RootComponent - picking one arbitrarily”

You can add the following line in the Projectile.cpp right after you define the CollisionMesh:
SetRootComponent(CollisionMesh);

This seemed to solve the error and get the particle emitter to display for me.

This ended up solving it for me but only when paired with some solid rebuilding efforts. I had rebooted, recompiled, cleaned the project etc., and nothing but a full rebuild from VS alone / editor restart after would get this going for me. Thanks for the help.

This helped me out but i was in need to comment everything related to LaunchBlast in cpp and h files then reload blueprint compile uncomment and compile than it worked.
Thanks :smiley:

Hey - the problem is attachtocomponent is not working correctly. As for others caching seems to do the job - in my case it helped to attach it in BP instead of C++. Like this:

this worked for me as well, plus restarting the editor, thank you!

It’s not help in 4.27

Privacy & Terms