Game Development Reference
In-Depth Information
Listing 89:
A script to link
RPGRocket
and
Breakable
The last script we have to add to rocket prefab is in fact the explosive material which
does the real destruction and causes explosions. When
OnRocketHit
message is received,
all destructible blocks in explosion range must be destructed and an explosion force must
be added to it. The script that performs this task is
DestructOnRocketHit
, which is shown is
Listing 90.