Adjust animationspeed in realtime?
Blitz3D Forums/Blitz3D Beginners Area/Adjust animationspeed in realtime?
| ||
Are there any ways to actually alter the animationspeed while the animation is playing without restarting the animationsequence? I got a thing spinning around on my mesh (animated with the mesh) and it will sping around the mesh faster sometimes without the program restarting the animationsequence. |
| ||
Global animspeed# = 1.0 If Not Animating (model) Animate model,1,animspeed#,1 End If Alter the speed whenever you need to? |
| ||
No, not what I was looking for. I need to alter the speed meanwhile its already animating in a loop. I cannot call Animate again because the sequence will then start over from frame 0 so I wonder if there are any other way to alter the animation speed meanwhile the animation is already playing. |
| ||
I use SetAnimTime instead. That way you need to track the progress of the animation, but it works great for this. Edit: see code posted below for example of how to use SetAnimTime to adjust an animation speed on the fly. |
| ||
You don't have to call Animate again. Just alter animspeed# and it should pick it up? Maybe not, I'm not able to test it at the moment. |
| ||
here is some code I didn't have time to post earlier. You will need to replace your own animated mesh in the code to make this run. |
| ||
UpdateWorld DeltaTime# |
| ||
Ice9 - that will affect all entities animation which is not what I think he is after. Pongo is correct - you will need to use SetAnimTime. It gives you far more control over animations in any case but there is a little more work involved. |
| ||
Thank you very much y'all! Especially you, pongo. I don't understand how the brain is functioning. I was looking for exactly such a command in the helpdocuments, ESPECIALLY in the Animationcategory but still I couldn't see it even if it was right there... Anyway thanks a lot!!! |
| ||
I was gonna point out the animation speed parameter for UpdateWorld, but ice beat me to it. SetAnimTime is so cool for stuff like scrubbing back and forth in an animation. I'm so glad Mark implemented that a couple years ago when I bunch of us requested that. |