Game Development Reference
In-Depth Information
3.
Save the script.
4.
Set the Weight to 0 , click Play, and test to make sure everything still works.
The weight goes to 1 as soon as you click Play.
Creating a Laser Beam
With the “mechanical” bit in place, it's time to create a laser beam graphic. For this, you will be using
a Line Renderer component. The beam length will be controlled with scripting.
1.
Hold the Alt key, and select the GardenGnome to expand it in the Hierarchy
view.
2.
Deactivate the Cap and the Gnome Arrow.
3.
In the Scene view, focus in on the Raygun and create a new Empty
GameObject.
4.
Name it Laser Point .
5.
Position it at the front of the RayGun mesh, and in Local coordinates, make
sure its Z points forward (Figure 11-23 ).
Figure 11-23. The new Laser Point object in place
6.
Drag and drop it onto the RayGun object in the Hierarchy view.
7.
From Component, Effects, add a Line Renderer component to the Laser
Point object.
8.
Uncheck Use World Space.
 
Search WWH ::




Custom Search