- Home /
Question by
Tomomoto · Jul 17, 2011 at 10:59 AM ·
animationspeedcharactermotor
Animation speed.
How i can change animation speed of "idle" to 0.5x here if I use character motor?
if (grounded) {
if (Input.GetKey("a"))
{
player.animation.Play("walk");
}
else if (Input.GetKey("d"))
{
player.animation.Play("walk");
}
else
{
player.animation.Play("idle");
}
velocity.y = Mathf.Min(velocity.y, 0);
}
Comment
Best Answer
Answer by FLASHDENMARK · Jul 17, 2011 at 11:04 AM
animation["Animation name"].speed = 0.5;
I believe that is how.
I tried on C# for animation["animation name"].speed = 0.5; it always says error
Error CS0664: Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type (CS0664) (Assembly-CSharp)
how to convert it to float?
Your answer
![](https://koobas.hobune.stream/wayback/20220612145534im_/https://answers.unity.com/themes/thub/images/avi.jpg)