I’m attempting to create a shockwave gun, similar to this: "Minority Report" weapon - YouTube
What do you guys think would be the best way to create this? I would like to be able to shoot props, ragdoll npcs and hopefully interact with particles (ie smoke).
I was thinking something on the lines of a sphere component that applies an impulse when an object is within it’s radius, but I would like other/better suggestions!
Initially, I’m not too worried about the visual effect at the moment (although some tips would be appreciated).
I think for something like that you could use a plane (+ a material that creates such an effect) with collision which will be spawned when you press the left mouse button. After it hit’s something, it will move the object (as long as the physics are enabled) and you should destroy the projectile. This should theoretically work
A plane could be easier, but what about if there are more than one object in the projectile’s pathway then if the projectile is destroyed only one of them will be effected. Think it would be best if it just had a lifetime and no collision, however this might not work because then you could shoot through walls. Hmm…
maybe then you can use a small plane with collision for hit and a larger one with overlap for add impulse for items on the pathway.
Use a sphere that expands, doing overlap tests.
When an object wasn’t overlapping last tick, but is overlapping now, and if it’s in the cone of effect, then it’s “hit”
If an object is “hit” then run a line trace from the object back to the shooter, to make sure no wall is in the way.
Once the trace comes back clean, apply a force impulse to the object.
That seems like a pretty great solution jwatte, I think I’ll try implement that. Could someone point me in the direction of the line trace code?
Also, is it possible to make it interact with particles?