Game Development Reference
In-Depth Information
The PotatoAmmo could stand to be more visible in the scene when fired.
15.
Select the PotatoAmmo prefab object in the Project view, and set its x, y, and
z scales to 1.1 each.
For traditional ammunition, where the velocity is high enough to overcome gravity, you would not use
gravity. Currently, the potato is moving too fast to make the game challenging. The player could keep
the Gnomatic Garden Defender near the gateway and the potatoes would easily reach to all corners
of the garden. If you give the potato more mass, it will slow down but pack a bigger wallop when it
hits something. The drag will make it harder to aim, as the potato will have to be shot up so it will
come down in the right place.
In the prefab's Rigidbody component, give it a Mass of 20 and a Drag of 1.2 .
1.
2.
Click Play, and check out the difference (Figure 8-6 ).
Figure 8-6. The new range for the potato gun
With the adjusted range, the player will be forced to drive the Gnomatic Garden Defender through
the scene to reach all of the Zombie bunnies. Let's see what no Gravity does. . .
In the PotatoAmmo prefab, turn off Use Gravity in the Rigidbody component.
3.
4.
Click Play, and test the potato gun.
The projectiles shoot straight out from the bazooka and congregate on the wall until they are
destroyed (Figure 8-7 ). Unless you we shooting Nerf ® balls, you would want them to be destroyed
immediately on collision if you were not using gravity.
 
Search WWH ::




Custom Search