Game Development Reference
In-Depth Information
The second script we are going to write as a handler for
OnRaycastHit
is
BulletForceRe-
ceiver
. This script, shown in Listing 53, is specific for objects that have rigid bodies, and
hence have dynamic physical behavior.
Listing 53:
A script that receives ray cast hit and reacts by applying impulse force to the rigid body