Game Development Reference
In-Depth Information
6.
Rotate it 180 degrees on the y axis if necessary so that the z points forward
with the gnome's orientation.
7.
Toggle off the scene lighting.
The z arrow should point forward.
8.
Using the ortho views, position the Fire Point at the front of the bazooka
(Figure 8-1 ).
Figure 8-1. The Fire Point positioned at the front of the bazooka
9.
Drag the PotatoLauncher script onto the Fire Point object.
10.
Drag the Fire Point onto the Bazooka Arm in the Hierarchy view.
Let's use a simple sphere for some quick experiments. The key component is the Rigidbody.
1.
Create a new Sphere, and scale it to 0.2 x 0.2 x 0.2 .
2.
Add a Rigidbody component to it.
3.
Drag it into the root Prefabs folder.
4.
Select the Fire Point, and drag the Sphere prefab onto its Projectile
parameter.
5.
Delete the Sphere in the scene.
6.
Click Play, and press the left mouse button, the left ctrl key or the Mac
equivalent.
The spheres fly out in a steady stream while the “Fire1” input is held down (Figure 8-2 ). Besides
making it too easy to obliterate the zombie bunny population, this many projectiles will quickly kill
the frame rate.
 
Search WWH ::




Custom Search