Game Development Reference
In-Depth Information
In this script, we also give the radius of the Capsule a value equal to 0.1 because we want
to make sure that our enemy is very close to the wall or collides with the wall to make it
jump, as shown in the following diagram:
For Physics.RayCast() , it is very similar to the funcion that we used in the irst chapter.
It basically casts a ray from the posiion of the enemy's rocket launcher to the player by
checking to see if there is anything blocking it, as shown in the following diagram:
Creating a hit-point UI
Now we are at the last step of this chapter. We will add the hit-point game object for the
player and enemy as well as create the HitPointUI script.
Engage Thrusters
Before we start creaing the HitPointUI script, we will need to create the HitPointUI
game object to contain it:
1. First, go to Unity and create an empty game object by going to GameObject | Create
Empty , and name it HitPointUI . Then, we will reset the Transform to default
as follows:
Position X: 0 Y: 0 Z: 0
Rotation X: 0 Y: 0 Z: 0
Scale X: 1 Y: 1 Z: 1
 
Search WWH ::




Custom Search