Game Development Reference
In-Depth Information
When the Player exits the Blizzard Zone into the small safe area between zones, he can see the
ominous drone at the far end. The player has already learned from the land mines that the black
ball is not friendly, but to up the tension he won't know the nature of the attack this time until it is
initiated (Figure 10-15 ).
Figure 10-15. The player character faces the enemy drone
In the Project panel Assets ➤ Prefab ➤ Scripts folder, create a new script named EnemyDroneAI.
Open it in MonoDevelop and edit the code as follows:
#pragma strict
public var playerTransform : Transform;
public var speed : float = 3.0f;
private var drone : Vector3;
private var target : Vector3;
private var distance : float;
function Update () {
if (playerTransform.position.z > 128 && playerTransform.position.z < 145) {
transform.LookAt(playerTransform);
Search WWH ::




Custom Search