I have a really annoying problem. I created an animation for throwing a grenade(first part of the picture) and set the arm position by script(so it stay in the sight of the character if looks up or down). If he now throws a grenade, his arm teleports to the startposition in the animation instead of going there smooth. How can I get CrossFade to fade the script-set position out, and the animation in?
It should CrossFade from the start of the green arrow to the end of it.
Answer by Ben Holmes
Apr 11, 2011 at 07:12 PM
animation.Crossfade() should work. But the way this should be done is to have the throw animation start with the arm in the normal position.
But when I try the following, it simply acts like animation.Play: animation.CrossFade(WeaponchangeAnimation.name);
And when I give a time limit like 1 second, the arm bounces a little bit up and down, but nothing else happens. Why?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
find animation ?
How to resume animation from last frame
Programming boat sails to turn according to wind direction
Check to see if animation is playing
crossfade doesn't work when no animation is playing