- Home /
how would I make a electric arc/lightning bolt spell effect?
I 'm curious how I would make something like this
Player presses a button causing a raycast, which makes an arc of electricity appear between him and the end of his raycast.
Now, I'm not sure how I would create the visual effect of the bolt. Would I instantiate something that is stretched between the player and the target? how would that work? or would I make a 2d texture that tiles itself forward?
Answer by Cherno · Sep 18, 2013 at 03:20 AM
I think it could be accomplished with a prefab Particle System. Give the prefab a cone shape with angle zero so you have a cylinder, and set it up to your liking. When it gets instantiated, move it's base (where the particles generate from) to the caster's hand or wand or whatever, and turn it towards the target. Then you set the cylinder's (cone's) height to the distance between cster and target. You could also try to work with the stretched billboard length ratio settings.
You could do it with a single particle or add smaller ones that add sparks etc. for special effects.
Answer by jjxtra · May 06, 2015 at 01:29 AM
I made an asset that does this and I think the bolts look very comparable to real lightning bolts. There is a web player example, as well as some videos and images.
Asset link: https://www.assetstore.unity3d.com/en/#!/content/34217
Your answer
![](https://koobas.hobune.stream/wayback/20220613114353im_/https://answers.unity.com/themes/thub/images/avi.jpg)