- Home /
2 Different animations with 2 different update modes?
is it possible to have 2 animations inside the animator that have different update modes? for example i need my running animation to be normal, but my idle animation to animate physics. any help would be grateful :) thanks!
perhaps you could just use Animator.update$$anonymous$$ode variable to switch it from runtime when the state changes?
Thanks for the reply :) I see what you mean, so I wrote this code to change the update mode when the animation is playing, but i'm getting an error: 'update$$anonymous$$ode' is not a member of 'Unity.Engine.Animation'.
#pragma strict
public var update$$anonymous$$ode: AnimatorUpdate$$anonymous$$ode;
var anim : Animation;
function Start () {
}
function Update ()
{
if (anim.IsPlaying("Run_Pistol"))
{
anim = anim.update$$anonymous$$ode.Normal;
}
}
You confused Animator with Animation - update$$anonymous$$ode is Animator (not Animation) class property
ah kk, thought java was somewhat easier. Also, I did what you said (took out update$$anonymous$$ode = in both if statements) but Unity says that it had no affect
yeah, but did you change it to anim.update$$anonymous$$ode value? Not sure how it looks in javascript, but in C# it'd look like this:
myAnimator.update$$anonymous$$ode = AnimatorUpdate$$anonymous$$ode.AnimatePhysics;
myAnimator.update$$anonymous$$ode = AnimatorUpdate$$anonymous$$ode.Normal;
as the Animator.update$$anonymous$$ode
variable is just an enum.
Javascript (not Java) is less popular than C# in Unity, I$$anonymous$$O a bit complicated.I also read some opinions that JS is slower than C#
Your answer
Follow this Question
Related Questions
Is there a way how to use both Animate Physics and Unscaled Time update modes in animator ? 0 Answers
Unity showing "animator" component instead of the "animation" component 2 Answers
Should we check animation condition in Update or FixedUpdatE? 3 Answers
Best way to - Animation Sync - Multiple gameObjects. 0 Answers
2D Animation does not start 1 Answer