- Home /
Question by
xavatarv · Apr 17, 2016 at 04:56 PM ·
animationanimator controllerdoor
Animator/Animations [error] cant run
Hello , i tried to make something to change the position and rotate . I used an animator controller with 3 animations idle/open/close , with 2 parametres open/close and i put the animator on the thing which i want to change the rotate and i put and the script too
error cs0103: the name 'Chest_Control' doesnt exist in the current context
using UnityEngine;
using System.Collections;
public class Chest1 : MonoBehaviour {
public Animator animator;
bool ChestOpen;
// Use this for initialization
void Start () {
ChestOpen = false;
animator = GetComponent<Animator>();
}
void OnTriggerStay(Collider col)
{
if(col.gameObject.tag == "Player")
{
if(Input.GetKeyUp(KeyCode.E))
{
ChestOpen = !ChestOpen;
if (ChestOpen)
{
Chest_Control("Open");
}
else
{
Chest_Control("Close");
}
}
}
}
}
i tried too without the animator , only with animations (2 animations open/close) and after in script i wrote the "Chest_Control" to animator.Play but again not run
What can i do to solve this ? What i do wrong on this ?
Comment