- Home /
This question was
closed Jun 06, 2014 at 08:06 AM by
CrilleStyles for the following reason:
Problem is not reproducible or outdated
Question by
CrilleStyles · May 31, 2014 at 07:54 AM ·
animationscript error
Animation script error
'Play' is not a member of 'UnityEngine.AnimationClip 'Hand' is not a member of 'UnityEngine.GameObject'
//this is my script
#pragma strict
var object : GameObject;
var Gun : AnimationClip;
var Hand : AnimationClip;
function Update(){
if (Input.GetKey("Fire1"));
Gun.Play();
yield WaitForSeconds (0.2);
object.Hand.Play();
}
Comment
Answer by karljj1 · May 31, 2014 at 09:12 AM
You dont call play on the clip, AnimationClip is used by Animation to play back animations. You add the clip to the animation component in the inspector and then call animation.Play( "clip name" );
So here
animation.Play( "Gun" );
yield WaitForSeconds( 0.2 );
animation.Play( "Hand" );