Join Jesse Freeman for an in-depth discussion in this video Connect animations, part of Unity 5: 2D Building an Adventure Game.
- [Instructor] We're now ready to connect up the animations…to our player in the game.…Let's go ahead and open up the Player C# script.…We're going to scroll up to the top,…and we're going to create a new private field…to store the reference to the game object's animator.…We'll make this private,…set it to a type, Animator,…and we'll call this animator.…Just like we did previously,…let's set the value of the animator…to the Animator component.…
Now that we have a reference to the animator,…let's go ahead and wire up which animations we should show.…The first thing we're going to want to do…is set the animation for when we're walking.…Inside of where we test…for the controller.moving.x condition…but below the condition where we test…for the maximum velocity,…let's go ahead and add our new animation.…Here, we'll tell the animator to set an Integer,…and we're going to call this Integer AnimState.…
You'll remember this name…from when we set up our animations.…We're going to set the value to one,…which will tell the state machine of the animator…
- Optimizing sprites and draw cells
- Cutting up sprite sheets
- Building animations
- Changing animations
- Creating a player
- Moving the player
- Building a level with a simple map
- Creating interactive objects
- Creating alien enemies
- Switching between scenes
Skill Level Intermediate
Build a Real-Time Strategy Game with Unity 5with Dan Violet Sagmiller3h 47m Intermediate
Careers in the Game Industrywith Christian Bradley1h 19m Beginner
1. Working with Sprites
2. Working with Animations
3. Creating a Player
4. Moving the Player
5. Building a Level
6. Interactive Objects
7. Alien and AI
8. Managing Scenes
Next steps1m 9s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.