- Home /
Question by
phatpixels · May 20, 2014 at 03:27 PM ·
animationvariablespeedfloat
Float var to control animation speed?
Hello Everyone,
im looking for a way to control animation speed with a float variable. Any ideas for this newby?
function Update () {
model.animation.PlayQueued(anims[Random.Range(0, anims.length)]);
Comment
Answer by Graham-Dunnett · May 20, 2014 at 04:14 PM
var mySpeed : float = 1.2f;
// in some code
animation["Walk"].speed = mySpeed;
Hi Graham, i tried the code below, but i get no response from my object. then i tried replacing the ["Spin"] with ("Spin") and an error appeared no expression of this type.
var mySpeed : float = 1.2f; var anims = ["Roll", "Spin"]; var model: GameObject;
function Update () {
// in some code
model.animation["Spin"].speed = mySpeed;
}