Animated Objects
Add more life to your environment with animated content
Last updated
Add more life to your environment with animated content
Last updated
In order to have animation within your world that is in sync amongst all users in there, you'll need to use AnimatiorView. AnimatorView allows you to play and swap between animations and sync them with all the users in the area.
Add AnimatorView and GuidComponent to a GameObject. Then, create an object with an animator, unless you already have one, add assign it to AnimatorView's Animator property field.
To change between different animations to play, call AnimatorView.Play(animationName). The animationName should coresspond to the name of the Animation asset.
Here is a brief explanation on the local variables:
Loop
Self explanatory. If the animation should start again after it ends.
Normalized Time Parameter Name
Name of the parameter in the animator controller used for progressing through the animation.
Layer Index
Layer index of the animator.
You'll also need to set up the Animator Controller to work with AnimatorView.
Create an Animator Controller in your project's assets.
Create a parameter of type float in your controller with the same name as your Normalized Time Paramter Name, by default it's "progress".
On each state, set the Motion Time to the parameter you just created.