In my script the Animation selection pop up shows no assets even though i have several?
I created a script for opening my doors in my level. The script needs an animator attached to it. I click the animator on the script the pop up screen that shows scenes and assets is empty. I have the animation and animator already made for the script but they dont show up in assets. i tried to drag them to the script on the animation box but it wont take it.
using UnityEngine;
public class SBDoorScript : MonoBehaviour {
//made this public so that you can directly assign the door to the variable
public Animator _animator;
private bool _isInsideTrigger = false;
void Start()
{
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
_isInsideTrigger = true;
}
}
void OnTriggerExit(Collider other)
{
if (other.tag == "Player")
{
_isInsideTrigger = false;
_animator.SetBool("open", false);
}
}
// Update is called once per frame
void Update()
{
if (_isInsideTrigger)
{
if (Input.GetKeyDown(KeyCode.E))
{
}
}
}
} this is the script. Please help immediately i have 2 days left for this level to be turned in from the date this is posted.
Your answer
Follow this Question
Related Questions
Play animations not included in the animator. 0 Answers
animation scirpting 1 Answer
Animator CrossFade or Animator Transition 1 Answer
Get when animator change state 0 Answers
How can I animate UV offsets of multiple materials? 0 Answers