Hello,
I was wondering if anyone could help me get my animation working. I have a fbx tree that I want the leaves to fall if the user clicks on it.
the coding I’ve used is this.
private var currentTree : GameObject;
//private var leavesFallen : boolean = false;
function Update () {
}
//EVENTS
function OnMouseDown () {
if(gameObject.tag == “Tree” /* leavesFallen == false*/) {
animation.Play(“Take 001”);
}
}
The fbx tree has separate leaves and the main part which is clicked on. I’ve tagged the tree “tree” and haven’t split the animations so it is just “Take 001”.
But when I click on the Tree in the game.
it says it can’t be found; even though the animation with its name is right there!