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

I'm Learning to script with a Tutorial video, and can't seem to find the solution to my problem.

$
0
0
**I keep getting this error**- Assets/Fighter.cs(29,63): error CS1061: Type `Mob[]' does not contain a definition for `getHit' and no extension method `getHit' of type `Mob[]' could be found (are you missing a using directive or an assembly reference?) using UnityEngine; using System.Collections; public class Mob : MonoBehaviour { public float speed; public float range; public CharacterController controller; public AnimationClip run; public AnimationClip idle; public Transform player; private int Health; // Use this for initialization void Start () { Health = 100; } // Update is called once per frame void Update () { if (!inRange ()) { Chase (); } else { animation.CrossFade(idle.name); } } bool inRange () { if(Vector3.Distance(transform.position, player.position)< range) { return true; } else { return false; } } public void getHit(int damage) { Health = Health - damage; } void Chase() { transform.LookAt (player.position); controller.SimpleMove (transform.forward * speed); animation.CrossFade (run.name); } void OnMouseOver() { player.GetComponent ().opponent = gameobject; } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>