This example VCI starts an animation when the grip button is pressed.
On the root object of VCI, add an
“Animation” or “Animator” component.
In this example, we use an “Animator”.
Open the Animation window.
On the menu bar, select [Window] > [Animation] > [Animation], OR press Ctrl + 6.
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 Anim1.anim.
Now you can edit the animation. For how to edit the animation, refer to Edit animation.
You can manage multiple animation in VCI.
To add a new animation, from the animation switch drop-down menu, click on [Create New Clip] to create a new animation file.
You can play the animation by specifying the name of the animation created.
function onUse(use) vci.assets._ALL_PlayAnimationFromName("Anim1", false) -- index:0, isLoop:false end
You can also specify an animation from the Index of the animation (the order the animations are added).
function onUse(use) vci.assets._ALL_PlayAnimationFromIndex(0, false) -- index:0, isLoop:false end