Heres my code… as far as im concerned this is supposed to work :P… but it won’t… the object this is applied too will detect the object without the if statement… but even though the object im trying to find has the right tag… it won’t work Please help!!
using UnityEngine;
using System.Collections;
public class AnimTrigger : MonoBehaviour {
void OnTriggerEnter (Collider col)
{
Animator animator = col.gameObject.GetComponent<Animator>();
if (col.gameObject.tag == "Enemy")
{
animator.SetInteger ("Area", 1);
Debug.Log("yep");
}
}
}