thomasbasford.files.wordpress.com€¦  · web viewnow we need to add parameters to our animation...

6
Introduction to Animation in Unity First we have to make sure our sprite texture type is set to Sprite and UI this can be done in the inspector. After that we have to use Sprite editor to make sure the sprite sheet is sliced properly so we can add animation to it.

Upload: others

Post on 31-Jan-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Introduction to Animation in Unity

(First we have to make sure our sprite texture type is set to Sprite and UI this can be done in the inspector.After that we have to use Sprite editor to make sure the sprite sheet is sliced properly so we can add animation to it.)

(Once you sliced your sprite it will show each element of the sprit sheet as a separate file. Using this we will order our animation.We then drag the sprite sheet to the scene but before we edit the animation we have to go to windows tab then select the Animation tab to open the Animation window. By playing the animation by clicking play if the frames aren’t there by default select the sprite in scene or drag only the frame that you want.)

(Under your new files will be the animation control which will bring up the Animator when click you can also bring this up by going to windows>> Animator.This is an animation state machine which will assign the animations of the character dependant on input.You can put them in logical order and can make transitions between states in any order. It is recommended to have any state in the middle.You can make transitions by right clicking on any of the state machines and click make transitionsThese let you link state machines together and mange input for animations.)

(Now we need to add Parameters to our animation this can be done by going to the parameters tab in animator and click on the pulse sign. This brings up a list parameters float, int, bool and trigger.When animation is played you will see which Anima state is called.In this one the base state spaceship is played and then the transition to Any state to spaceship plays in a lope that repeats the final frames of spaceship.)

(By altering the space between the keys of the animation we can speed up or slow down the animation by ever adding a space between the keys to slow down the transition between the frames or by putting the keys close together speeding up the transition between the frames.)

(We can also use animation for position; scale a rotation of the sprites by adding them using the transform property. We then over lap them with the sprites animation which scale, rotate or move the position of the sprite as it is playing.)