Question by
22222222 · Nov 07, 2015 at 05:45 PM ·
strange ioc
Hey im trying to make an animation appear once when i press the left mouse click but i don't understand what the code should be to activate the animation when the button is pressed could someone help me!
Here is what i tried to do:
using UnityEngine; using System.Collections;
public class MyClassName : MonoBehaviour {
void Start () { anim = GetComponent ();
if(Input.GetMouseDown (0))
{
GetComponent<Animation>().Play("Door open");
}
}
}
Comment