- Home /
Convert BPM to Animation.speed
Hello everyone, I have an interesting problem to solve. I have an animation - an exercise done by a 3D model. I know that the animation for this character was recorded in 20 bpm (beats per minute). Now, I want to be able to modify the bpm in Unity, the only function I know to change speed of an animation is animation.speed. So now I have a formula:
speed = bpm/20
this formula means that if the given bpm value is 20 then the speed is 1, this sounds ok. But, if I give the value of 120 bpm, that would result in a speed of 6, which is way faster than it should be. In the end, I guess I need a formula to convert the bpm into the speed of the animation correctly. I searched for similar topics on the web but I didn't find any suitable answer, so any suggestions are welcome. Thanks! ;)
6x20 = 120. So it's exactly as fast as it should be at that BP$$anonymous$$.
nope, it means that he does the exercise 6 times faster, which is not the same as doing the exercise at 120bpm.
The math looks right to me too. Is this a looping animation? If so the animation could easily get out of sync if it's off by just a frame.
Sorry but that is incorrect. 40 BP$$anonymous$$ is indeed twice as fast as 20 BP$$anonymous$$. I think there is some confusion here. Do you mean you want to scale the animation, so if you set it to 60 BP$$anonymous$$, then you want to play the animation once within 60 BP$$anonymous$$?
speed = 20/bpm;
If bpm is 20, anim plays at normal timeScale. if bpm is 60, anim is played at 1/3 the speed so it only loops once every 60 BP$$anonymous$$s, not 20. Is this what you meant?
To clarify :
One loop lasts for 20 beats
to play that 1 loop over 60 beats = 20 / 60
to play the loop at 60 beats ins$$anonymous$$d = 60 / 20
Then you want to halve the 20 bpm animation so that it lasts for 40 bpm ins$$anonymous$$d. to play that 1 loop over 40 beats = 20 / 40 = half-speed =]
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Play Two Animations Simultaneously using Animator 2 Answers
Animated Billboard or Animated Model? 2 Answers
Creating an animated raising "force field"? 1 Answer
Why is my animation not being played? 0 Answers