Hi, I am a Student and I am making a simple game for a project. I have been trying to get fireplaces to light up and die out using an interact button. I have successfully got the fireplace to light up when my player character presses E. Now I want to be able to switch the fire off if I press E again, But I have no idea how, does anyone have suggestions for me?
Hi, @Tortalduifi, welcome to the forums.
When you use the Spawn System to spawn your niagara system, you can keep a reference to the object, which is returned by that node.
Here, you can use the DestroyComponent to kill that system.
You can use a FlipFlop node to make the fire to switch on and off… Let me make an example. Here’ I’m not promoting the returned reference to a separate variable.
Also no checks are done, e.g. if the variable is still valid, but you should be able to get the point from this.
Hey there @Tortalduifi! Welcome to the community! Herb already went over one way which is creating and destroying the particle system.
However if you’re using Niagara particle systems there is a way to directly change parameters on them! This is incredibly helpful for enabling/disabling systems or parts of them, changing meshes/particles, raising or lowering the amount of particles, changing colors, and more!
You can set User Exposed variables here. These have to be bound to a variable on the system.
You have to drag the variable to what you want it to control.
Using the Set Niagara Variable nodes you can set the variables specifically at runtime. In this example I’m changing the particle count from 0 to 200, and after that setting them to be a random linear color with 3 random values.
This way if you need a persistent system you need to edit on the fly programatically at runtime, you can! Hope this helps!
Thank you @herb64, It worked perfectly! Just what I needed and was really quick and easy!
Also Thank you @SupportiveEntity, I used a particle system that was already part of a pack and it wasn’t a Niagara system however I want to play more with Niagara so I will defiantly keep your comment in mind when I do.
And thank you for the warm welcome you all are really nice.