Animation Speed Problem

I try to Play a Animation Backwards, but i stuck and cant locate the misstake.

This is my Script:

function maintooptions () {
	animation.Play("maintooptions");
}
function maintochose () {
	animation.Play("maintochose");
}
function backtooptions () {
	animation.Play("maintooptions").speed = -1;
}

and this is the shown Error:

Assets/Scripts/Menue/Camerascript.js(11,53): BCE0019: ‘speed’ is not a member of ‘boolean’.

2 Answers

2

for (var state : AnimationState in animation) {
state.speed = -1;
}

this will make the animation go backwards

But this make that all Animation go Backwards

animation[“maintooptions”].speed = -1;
animation.Play(“maintooptions”);

You can’t string these functions, since animation.Play() returns a boolean value;

Thanks, you rescured my Day