Synchronizing subtitles
In this recipe, we create subtitles and synchronize them with the animation:
Subtitles synchronized with animation
Getting ready
In this recipe, we will use the same cutscene as in the previous one. You can also open the example Unity project and go to the Chapter 08 Animating Cutscenes\Recipe 05 Synchronizing subtitles
directory. If you open the Example.unity
scene there and play the game, you will see changing subtitles synchronized with the animation.
How to do it...
To synchronize subtitles with a cutscene, follow these steps:
- Import the cutscene the same way as in the previous recipe.
- Create a new
Image
(go toGame Object
|UI
|Image
). - Name it
SubtitlesContainer
. - Create a new Text game object and parent it to the
SubtitlesContainer
. To do so, right-click on theSubtitlesContainer
and chooseUI
|Text
. - Change the color of the
SubtitlesContainer
'sImage
component to semitransparent black. Change the color of theText
component to white. Adjust the position and size of the...