4: Creating an Animator Controller

 Step 1:
Create a new Animator Controller by right clicking in the project window and selecting Create > Animator Controller and name it. (We have called it BOX_Controller)

Step 2:
Drag the box model into your scene and attach the new Animator Controller to it in the Animator component in the inspector.

Step 3:
Open the Animator Window (Window > Animator). Slect the box model in the Hierarchy window, and drag in the BOX_OPEN animation we created earlire. This will set the open box animation as the default animation. We do this to test whether the animation works. Preview your game and chack that the box lid opens. Now right click on the open box animation in the animator window and delete it.

Step 4:
Drag the idle box animation into the now blank animator window followed by the open box animation. The idle box animation should be orange and the open box animation should be grey.

Step 5:
We now need to set up the parameters and transitions so we can control the animations via script in the next stage. Slect the Parameters tab and click the add icon. Choose Bool from the drop down and name your Parameter OPEN.

Step 6:
Now we will create the transitions. Right click the box idle animation and select Make Transition.

Now drag the transition line to the open box animation to connect the transition.

Step 7:
Now select the transition arrow (It will turn blue) and in the Inspector window uncheck Has Exit Time. Otherwise it will wait for the first idle animation to finish before it triggers the open animation and we want this to happen instantly. Then select the add icon unerconditions and select the OPEN parameter to be true.

Casino Bet 365 is best casino in the world.

What's Next

Next up for Unity Snippets is a look at game development articles from across the web...

Free Templates - bigtheme.net
Popular Art Betting make bookies articles.