====== Animation locations ====== You may incorporate animation into the GLB location by creating animation clip in Unity. For this example, let's us create an animation to move a basket on [[https://en.wikipedia.org/wiki/Kotatsu | Japanese Kotatsu table]]. {{niconico3d:glb_anim1.png?direct&400|}} ===== Create an animation clip ===== {{niconico3d:glb_anim2.png?direct&300|}} Select the root object to export as GLB. Click on Add Component in the Inspector\\ and select **[Miscellaneous] > [Animation]** to add an animation clip. {{niconico3d:glb_anim3.png?direct&300|}} Open the Animation window.\\ On the menu bar, select **[Window] > [Animation] > [Animation]**, OR press **Ctrl + 6**. {{niconico3d:glb_anim4.png?direct&300|}} On the Animation window, click **Create** to create an animation clip.\\ You may create it in any place easy to find. For this example, we will create a folder called "Animation" and name the file as Kotatsu.anim. {{niconico3d:glb_anim8.png?direct&300|}} On the root object, add the "Kotatsu.anim" we just created. ====== Edit animation ====== {{niconico3d:glb_anim5.png?direct&300|}} Click on the record button (the red circle) in the Animation window.\\ The timeline bar will turn red as you can see in the figure at the right. You can edit the animation in this state. {{niconico3d:glb_anim6.png?direct&300|}} Add a subject to move with the animation.\\ You can incorporate three kinds of elements into GLB animation.\\ * Position\\ * Rotation\\ * Scale\\ In this example, we will create an animation that rotates in a place forever.\\ Click on [Add Property] and select **["the object to move"] > [Transform] > [Rotation]**. {{ niconico3d:glb_anim7.png?direct&300|}} Specify a degree of the rotation.\\ Click on the beginning of the timeline and specify the Rotation of the object as "0."\\ Click on the end of the timeline and specify the Rotation of the object as "360." Clicking on the play button (button with a triangle) will play the rotating animation.\\ {{niconico3d:glb_anim_rotation.mp4?direct&450|}} While this animation is okay, if you are not happy with the automatic deceleration at the looping point of the animation, refer to [[en:unity:trouble#Animation decelerates automatically|Troubleshooting: Animation decelerates automatically]]. While we created a rotating animation in this example, you can also incorporate position and scale into your animation as well.\\ However, please remember that Virtual Cast only recognizes **animation clips integrated into the root object only**. Therefore, animations integrated into child objects do not work. ===== Export GLB ===== {{ niconico3d:glb_anim9.png?direct&300|}} Just like with the standard [[glb:make#Export GLB|GLB export]], select the root object of the location, and\\ select **[VRM] > [UniGLTF-1.28] > [Export]** to export.\\ Make sure that the animation clip is in the root object.