Hi guys,
The animation controller does not seem to be able to return the name of the current animation.
I created a new function:
/**
* returns the name of the currently playing animation
*/
public function get currentAnimation():String {
for (var prop in _clips) {
if (_clips[prop] == clip) {
return prop;
}
}
return null;
}
I just needed to make “clip” a class level var instead of a local var in SmoothSkeletonAnimator.as
Now, if you want to check if you are already playing an animation like “jump” you can just check for that property
if (character.onGround() && _animationController.currentAnimation=="jump") {
_animationController.play("idle", 0.2);
_animationController.timeScale = TIME_SCALE;
}
Seems to work well. Do you guys want to add this?