How to change animation speed during play
by Eric Preston · in Torque Game Builder · 08/23/2009 (9:21 am) · 4 replies
I have an animation of a running dog that I would like to have vary with the animated sprites speed. Something like:
sprite.animationTime *= 1/speed;
But, it does not seem to be possible to reset .animationTime while the animation is playing. Anyone know how to do this?
Many thanks for any help.
Eric
sprite.animationTime *= 1/speed;
But, it does not seem to be possible to reset .animationTime while the animation is playing. Anyone know how to do this?
Many thanks for any help.
Eric
About the author
#3
09/24/2009 (7:23 am)
hey i also tried that one. plz gimme details
#4
%speed = getWord(object.getLinearVelocityPolar(),1);
if(%speed < 5)
%this.owner.playAnimation(Walk,false, -1, true);
if(%speed >= 5 && %speed < 15)
%this.owner.playAnimation(RunSlow,false, -1, true);
if(%speed >= 15 && %speed < 30)
%this.owner.playAnimation(RunMedium,false, -1, true);
if(%speed >= 30 )
%this.owner.playAnimation(RunFast,false, -1, true);
09/24/2009 (8:51 am)
Here is the code I tried. It works for me.%speed = getWord(object.getLinearVelocityPolar(),1);
if(%speed < 5)
%this.owner.playAnimation(Walk,false, -1, true);
if(%speed >= 5 && %speed < 15)
%this.owner.playAnimation(RunSlow,false, -1, true);
if(%speed >= 15 && %speed < 30)
%this.owner.playAnimation(RunMedium,false, -1, true);
if(%speed >= 30 )
%this.owner.playAnimation(RunFast,false, -1, true);
Torque Owner Eyal Erez