- Home /
how do I create a Ghostbusters beam
Hi All,
I have a very open ended question for you and I hope someone can help me. I'm currently developing a game which is similar to a 1st person shooter, but instead of shooting guns we're shooting rays which we hope will end up looking similar to the Ghostbusters rays
please see this link for ref (at the 1:22 mark) https://www.youtube.com/watch?v=YUQeL5E6-w0
My question: should I pre-render this effect in my 3d package and map it on planes inside Unity (1 plane per ray) or is there an draw-call-efficient solution to create this dynamically inside unity?
looking forward to hearing your thoughts!
Thanks Jeppe
I think this would be possible with a procedural mesh, 1 drawcall but maybe a little expensive to calculate/render. Imagine a straight line between the player and the target, then divide that line into lots of connecting lines, imagine where each cut in the line is a node :
|----|----|----|----|----|----|----|----| <- nodes
Find how long the beam is, calculate where you want 'nodes' and how many for the lightening to change direction (zigzag). Generate a mesh with 3 quads between each node, and update their verts to an offset with perlin noise, eg the first node goes up a bit, the second node goes right a bit, the third node goes forward a bit , etc etc =]
Something that works very similar to what I am describing can be seen in this free unity package, Procedural Examples : http://u3d.as/content/unity-technologies/procedural-examples/3zu
Thank you alucardj - this was very helpful - just the the example I was looking for!
Answer by kaiserkappel · Dec 13, 2012 at 05:29 PM
Maybe you could play around with Unity's particle system and see if it gives the desired effect? I'm currently following one of their tutorials that you can download from the asset store (download "3D Platformer Tutorial" under the Complete Projects tab) and in the accompanying PDF starting on page 22, they discuss some of the particle effects that are in Unity. I wouldn't be surprised if you could play around with it and create a beam-like particle and then script the accompanying damage effects of it. But I'm just speculating so I hope it helps.
EDIT: Also found this for Particle Collision detection: http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnParticleCollision.html