FPS weapon ideas

###I have ideas for a gun that launches electrically charged javelins. Individually, they’re charged with electricity, but when fired in succession across a surface like the floor or from wall to wall, an electric fence is built where currents of electricity can cause minor harm to players passing through the current. Problem is I don’t know where to start.###

I know its old but just in case someone comes looking. off the top of my head start by creating a javelin projectile that flies and lands how you want, when it impacts with the wall or floor have it spawn an actor class with the same static mesh and give it the same location and rotation and then have the projectile destroy its self.

I imagine you might want a javelin to be only able to link to two other javelins so create a variable and call it “links” set it as an intiger and keep it at 0. create a scene component for each arc of electricity you want and place them along the shaft of the javelin where you want the electricity to come from.

on spawn you want it to look for any other javalins except itself. filter out any which are too far away and any that have “links” at 2 or more. then out of those that are left, if any, get the nearest one and store it as an object variable then Increase the variable “links” in both the target javelin and the spawned javelin (to stop multiple javalins linking to the target).

from an event tick create a ray trace from each scene component in the spawned object to its corresponding scene component in the target and use that to draw a particle effect and to trigger damage when a player crosses. you could also set it to relook for a new target every second or so if you want it to adapt then just refine from there.