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

get this error Assets/PlayerDecection.cs(12,33): error CS1061: Type `AnimalAI' does not contain a definition for `Player' and no extension method `Player' of type `AnimalAI' could be found (are you missing a using directive or an assembly reference?)

$
0
0
this is my code: using UnityEngine; using System.Collections; public class PlayerDecection : MonoBehaviour { public AnimalAI AIMotor; public AudioClip SFX; void OnTriggerEnter (Collider col) { if(col.tag == "Player") { AIMotor.Player = col.gameObject; AIMotor.PlayerOnSight = true; GetComponent().PlayOneShot(SFX); } } void OnTriggerExit (Collider col) { if(col.tag == "Player") { AIMotor.Player = null; AIMotor.PlayerOnSight = false; GetComponent().Stop(); } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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