i want to play an animation once the player hits a collider. i tried using this:
if(collider.tag == “anim_trigger1”)
{
this.transform.GetComponent(Animation).animation.Play (“enemy”);
}
where “anim_trigger1” is the tag of the collider and “enemy” is the name of the animation applied on another object.
And i’m getting the following error:
"*Assets/script/player_control. j s(38,72): B C E 0 144: ‘Unity Engine .Component.animation’ is obsolete. Property animation has been deprecated. Use Get Component() instead. "…
thanks in advance