is there a tutorial for making animated lasers?

hey ladies and gents. I am just curious. I am doing a laser effect in Unity3d (or rather trying lol). I am wondering if there is any basic laser tutorials for Unity3d? I am more of an artist, so I am not much of a coder, though I have the willing to learn if need be. But I am unsure which direction I should go.

I remember reading last friday about using raycasting or something. So far I have a texture of a blue laser, and I am using a line renderer. However, despite animating it using the animation tool in unity3d, I would imagine i would have to have some emission point or 'destination" for the laser to grab or animate to such as a ship or object at a random distant as animating i am sure does not compensate for random distances on a level or grid.

I am not asking for code necessarily I would like to learn this myself, I just would like at least a starting point on how to approach this, so as to minimize wasting time and get this done. So far I have completed explosions using detonator which was relatively easy. but doing weapons effects I am certain will require a tad bit of coding to implement.

Anyone willing to assist me to get me rolling? thanx in advance for any and all assistance you can offer. i will be patiently waiting a response. enjoy your day.

-James

If you’re referring to “proper” lasers (as opposed to, say, storm trooper blaster shots), you could probably do the following:

  1. ensure your laser mesh has its origin at one end (as opposed to in the center), and that it is exactly 1 unit long
  2. determine a max range (let’s say 100m)
  3. do a raycast, see if it hits anything
  4. if it hits something, get the transform of the contact
  5. instantiate the laser mesh at the point of origin (weapon muzzle), set its rotation to the weapon’s rotation
  6. scale the laser mesh by the distance from muzzle to contact

3a. if it doesn’t hit anything, then just instantiate the laser mesh and scale it in the appropriate axis by the max range (100).

For the actual animation, either animate the alpha, or have a few frames of animation in the texture to fade out.