Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

CS1519 HELP

$
0
0
![alt text][1] [1]: /storage/temp/48580-capture.jpg using UnityEngine; using System.Collections; public class EnemyController : MonoBehaviour { NavMeshAgent nav; Transform player; Animator controller; float health; GameManagement game; CapsuleCollider capsuleCollider void Awake () { nav = GetComponent (); player = GameObject.FindGameObjectWithTag ("player").transform; controller = GetComponentInParent (); game = FindObjectOfType (); health = 20 + (1.25f * game.round); capsuleCollider = GetComponent (); } // Update is called once per frame void Update () { nav.SetDestination (player.position); controller.SetFloat ("speed", Mathf.Abs (nav.velocity.x) + Mathf.Abs (nav.velocity.z)); } void applyDamage (float damage) { health -= damage; if (health <= 0) death (); } void Death () { nav.Stop (); capsuleCollider.isTrigger = true; Destroy (gameObject, 4f); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles