Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
ahmedelbarky

animation problem

Question

Can any one help me when i add an animation to my character no error found and no animation play? :((

i use this script

if(In.GetKey("w")){

animation.Crossfade("walk")

}

Share this post


Link to post
Share on other sites

36 answers to this question

Recommended Posts


  • 0

Please login or register to see this link.

Crossfade queued is what your looking for. It will allow you to play the animation after the rest have finished. However READ that page because it contains 2 types, so you need to choose which one you need.

Share this post


Link to post
Share on other sites
  • 0

Look. You need to play the othre animation. Ignore crossfade but use it. Basically that fades between the last position and the animation to make it smoother and more realistic. Anyway, you need to play the walk animation first with animation.CrossFade("Walk");

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

it works but i have some problem when i made that it went to the other animation after the first is done but the first animation repeat itself and when i press up the key the other animation work!!! :(

*Edited

Share this post


Link to post
Share on other sites
  • 0

You see on the Animation component. untick play automatically. Then on culling type try Based on Renderers or Always Animate.

Share this post


Link to post
Share on other sites
  • 0

well like he said, take of play automatically or whatever. But your script is:

if(Input.GetKey("w")){

animation.CrossFadeQueued("Run", 0.3, QueueMode.CompleteOthers);

}

Basically that means that you are NOT going to run unless you press "w". Therefore if you want it to walk then start running when you press "w" :

if(Input.GetKey("w")){

animation.CrossFade("Walk");

animation.CrossFadeQueued("Run", 0.3, QueueMode.CompleteOthers);

}

Now remember, make sure walk does NOT loop else I don't think run will play, not sure on this.

Share this post


Link to post
Share on other sites
  • 0

Here you can find answers on all your questions:

Please login or register to see this link.

Share this post


Link to post
Share on other sites
  • 0

YEAAAAAAAAAAAAAAAAAAAAAAA thanks to everyone who was trying to help me but finally i have found the solution

Please login or register to see this code.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...