- Home /
Question by
sdp · Feb 03, 2013 at 03:51 AM ·
javascriptanimatormecanimaccessanimationstate
accessing animation states from animator in javascript
Hi,
Like in the video tutorial for mecanim, I want to know which animation state is active. In the tutorial they are using a c# script, but since my other scripts are javascripts I'd like to keep it that way. I tried different ways to do it but none of them worked. Actually these lines should be converted:
static int idleState = Animator.StringToHash("Base Layer.Idle");
void FixedUpdate () {
if(currentBaseState.nameHash == "idleState"){
do things;
}
thank you
Comment
Your answer
Follow this Question
Related Questions
How to script SetTrigger (JS)? 1 Answer
Can Mecanim/Animator be used to make Enemy AI's? -1 Answers
Get the clip length (accounting for speed multipliers) of any animation state at runtime 1 Answer
Why does this animator appear to occupy two states, but report only one? 0 Answers
Javascript controlling Mecanim? 1 Answer