Game Development Reference
In-Depth Information
visible. In the case of the quad we use, it is enough to move it along its negative z axis
by 0.0125. Additionally, we need to keep the number of holes in the scene limit in or-
der to avoid performance issues. Therefore, we specify a life time for the hole that can be
set through holeLife . After creating, rotating, and positioning the hole, Destroy() is called
for the newly created hole and is given holeLife value as wait time before destruction.
Remember that we used the member distance of RaycastHit to store the scaled damage
value computed using the power of the bullet. This value is printed along with the name of
the hit object so that you get an idea about the scaled value of the damage. All we have to
do now is to attach this script to any object we want, and provide it with the prefab of the
hole it should create.
Search WWH ::




Custom Search