|
I m trying to play 2 animation run & jump ,in inspector both have take001 animation,i m using crossfade but my program is not working,can any one help ? code
(comments are locked)
|
|
Those two lines doesn't make mush sense: You add the default clip of the animation component 2 more times to the component with a different name. Also your two public Animation references seems to be a bit strange. What other animation components have you linked there? I guess you want to add AnimationClips. So either add the clips in the inspector directly to the Animation component, or if you want to add them via code, make the public variables of type AnimationClip and add them to the animation component. Next thing is: wrapmode and layers should be set in Start and not in Update (unless you plan to overwrite them somewhere at some time). Last thing is:I guess you mixed up your animations. the walk animation should be looping and the jump animation should be playing once. Also You play the animation again and again while the input axis is greater than 0.2. Are you sure that's what you want? Usually a jump is a one time action and you should use Input.GetButtonDown, but that's a conceptual thing we can't answer for you.
(comments are locked)
|

showing your code, easily can have a good answer,
past code editing your answer, after past the code select it all and press the 101010 button
Yea that's really hard to read, i can see you have a lot of things commented out though.
I formatted your code for you. Hopefully I didn't ruin anything.
i think u have not try to understand the code , i solve out my problem my code is running well..
@rakesh12: don't post replies as answers. This is a Q&A site. Answers should answer the question. For annotations there are comments (the "add new comment" button).
I've converted your answer into a comment