Game Development Reference
In-Depth Information
time is stored in
lastShootTime
, and the message
OnRaycastShoot
is sent. This latter
message can be useful if we need to do some stuff in combination with shooting, such as
playing a sound or an animation. We can also access the values of last inaccuracy vector,
by calling
GetLastInaccuracyVector()
. This can help us in camera shaking, or gun anima-
tion as we do in
RaycastShooterAnimator
shown in Listing 50. The job of this script is to
animate the gun during shooting, so that the player gets on-screen feedback that the shoot-
ing actually happened.