Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by LastTemplar · Sep 19, 2012 at 06:08 PM · animationspeed

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! ;)

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Khada · Sep 19, 2012 at 06:13 PM 0
Share

6x20 = 120. So it's exactly as fast as it should be at that BP$$anonymous$$.

avatar image LastTemplar · Sep 19, 2012 at 06:22 PM 0
Share

nope, it means that he does the exercise 6 times faster, which is not the same as doing the exercise at 120bpm.

avatar image ThermalFusion · Sep 19, 2012 at 06:24 PM 0
Share

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.

avatar image AlucardJay · Sep 19, 2012 at 06:57 PM 2
Share

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

avatar image AlucardJay · Sep 19, 2012 at 07:11 PM 1
Share

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 =]

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges