Hello, I would like help regarding an action that I want to perform in my game, on my map there will be cut, unsoldered electrical cables, which will project sparks. I would like the event to be in a loop and that it activates 5s deactivates for 5 s turns back on ect.
Obviously it would inflict damage and when the cables do not produce sparks the damage is not inflicted.
I tried with loops without achieving much and now with a set timer by event I feel that I am perhaps very far from the result but I am stuck on how to do it?
Hey @camerone95! Let’s get this sorted!
Okay, so firstly, on the event attached to the timer, you’ll add a flip-flop node directly after the event before any code.
On the “A” path, you’ll want to “Set Emitter Enable” on your Niagara Particle System Component, not Add.
(To facilitate this, add the NPS component to the blueprint itself, in editor. Then in the details of that component, mark it as “Start Enabled: False”.)
Continuing down the “A” path, you’ll get your collision volume and use “Set Collision Enabled”, and set it to “Query Only” because you’re going to want to use the “Overlap” functionality, not hit. “Hit” is for blocking collisions.
On the “B” path you just want to do the opposite.
So every time this event runs, it will alternate execution lines, first turning on, then turning off, then turning on, etc.
Next, you want to look at your collision.
This should be all you’ll need, it will overlap with any pawn and apply damage. This means you can also have it affect enemies.
Hope that helps, have a great day!
hey thank you very much for taking the time it works perfectly thanks again!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.