x


Animation layer problem

Hello

Please can anyone help me cause i haven't found an issu for my problem. I have a rotate animation wich is supposed to be played when i rotate my player, but when i rotate my player the animation doesn't work and my idle animation continue to play like nothing happen. I have tried to make the rotate animation in layer1, but in this case the rotate animation replace the idle and i can't play any other animation Here is my code

if(Input.GetButton("Horizontal"))
       {
       myTransform.Rotate(0, Input.GetAxis("Horizontal")*Time.deltaTime*speedRotation,0);
         if(animation.IsPlaying("idle"))
         {
         animation.CrossFade("rotation");
           }                     
       }
    else
    {  
       animation.CrossFade("idle");  
    }

thank you

PS: can anyone explain me the difference between the animation.weight and the animation.layer, i have read the documentation but i haven't understood yet

more ▼

asked May 10 '12 at 12:41 AM

zakkar gravatar image

zakkar
1 5 9 11

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3796
x665
x150
x27
x25

asked: May 10 '12 at 12:41 AM

Seen: 362 times

Last Updated: May 10 '12 at 12:41 AM