#pragma strict
function Start ()
{
var Axe = ("Axe");
var resetTime = 0.0000000000000000;
var useBackwards = true;
}
function Update ()
{
if(Input.GetKeyDown("F"))
GetComponent.<Animation>()Axe.Play;
}
#pragma strict
function Start ()
{
var Axe = ("Axe");
var resetTime = 0.0000000000000000;
var useBackwards = true;
}
function Update ()
{
if(Input.GetKeyDown("F"))
GetComponent.<Animation>()Axe.Play;
}
Well i’m not a javascript guy, but I would have thought the last line should be more like this.
GetComponent<Animation>().Play(Axe);
Since GetComponent should not want a . before the generic type, and putting .Axe on the end would be trying to access a variable on the animation component called “Axe” which I don’t think is a thing.
So the GetComponent() returns an Animation object, .Play() is the method to call on that component, and Axe is the variable “Axe” which I’m guessing is the name of the animation you want to play.