Game Development Reference
In-Depth Information
Figure 11-29. The improved laser beam
With the addition of the material, the laser beam may be a bit thin.
3.
Stop Play mode.
4.
Set the Start Width and End Width to 0.1 .
You may also have noticed that the beam gets darker near the shadowed side of the wall. Shadow
calculations are usually expensive, so it's a good practice to turn them off whenever an object
warrants it.
5.
Uncheck Cast Shadows and Receive Shadows.
Creating the UV Animator Script
For the pulsing effect, you will be animating the shader's X Offset. A UV animator script comes in
handy for lots of things, so as long as you are adding code to animate the regular texture, you will
include the means to animate a bump as well. Since you may not want to use both all the time, you
will make them both optional.
Texture offsets work on a 0 to 1 basis, where 1 is a full loop. You can adjust the offset in the shader
to see the effect before you begin.
1.
Select the Laser Point and zoom in on the line renderer in the Scene view
(Figure 11-30 ).
 
Search WWH ::




Custom Search