Game Development Reference
In-Depth Information
4.4 Ray cast shooting
In this section we are going to extend the first person character we made in section 4.3, by
giving it the ability to shoot bullets. This time we are going to learn a new technique to
implement shooting, which is ray casting. We have already dealt with a simple usage of
ray casting to test character grounding. However, in this section we need more detailed
information about the result of ray casting. Let's begin by adding a simple gun model and a
crosshair for the character. These two objects must be added as children for the camera, and
must be adjusted to give the first person view. When the game runs, the gun and the crosshair
should appear as in Illustration 61.
Illustration 61: A simple gun and a crosshair made of basic shapes and added to the first person camera
Search WWH ::




Custom Search