- Home /
Question by
TalalAslam · Nov 04, 2012 at 07:01 PM ·
c#animation
How to reduce Animation duration dynamically in c# script
i want to reduce animation duration in c# script, means if a animation on gameobject is completed in 2 sec than on a click it will completed in 1sec. thanks kindly response quick.
Comment
Best Answer
Answer by valyard · Nov 04, 2012 at 11:45 PM
You can use AnimationState.speed property to increase animation's speed.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Example() {
animation["Walk"].speed = 2;
}
}