Hi everyone thi is my first post here, sorry if it’s not pertinent or something…
I’m working on making an area trigger to open some kind of automatic doors and always gets errors in the console, so i’m getting a bit lost in my animators ans script…
So, i put an area as trigger already, an animated door parented to it.
I made a script to call the animator on trigger like this :
using UnityEngine;
using System.Collections;
public class xareadetection : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OncollisionEnter(Collider col){
if (col.gameObject.name == "player"){
GetComponent<Animator>("xaporte2");
Animator.settrigger.xaerad = true;
}
}
void OnTriggerExit(Collider col){
}
}
And recieve errors again ( i tryed some other way like calling like animator.settrigger =true; this way were apparently obselete.
I recieve as error :
Assets/xascripts/xareadetection.cs(17,25): error CS0308: The non-generic method `UnityEngine.Component.GetComponent(System.Type)’ cannot be used with the type arguments
Assets/xascripts/xareadetection.cs(18,26): error CS0117: UnityEngine.Animator' does not contain a definition for
settrigger’
does “settrigger” don’t exist? does the syntax about getcomponent is false?
thanks in advance for some help…
Dhorn