- Home /
How to control speed of animation on Unity by a .txt file?
I am trying to controlling the flow of an 3D animation on unity through the sound. Therefore, through a synthesizer sounds, get the BPM of a song, which are stored in a file. Txt, with the given time and the number of BPM in second. Then in Unity, I have a pre-defined animation, and already carry the file with the information of BPM, but now I do not know how I can make the animation speed is controlled by the information in that file. Any idea?
Answer by Graham-Dunnett · Jun 02, 2014 at 09:54 PM
Add the text file into your Resources folder. Then it's accessible in your game code as a TextAsset. See:
yes I know ... That was done. What I want is that the speed of the animation adapts to the information I get from this. Txt file. For example, when 5.6 seconds is 180 BP$$anonymous$$, and 6.2 seconds is 215 BP$$anonymous$$. The logic would be the animation speed go-adapting to the music.