Nerd For Tech
Published in

Nerd For Tech

Daily Progression — Setting Up Player Animations

The next task was to bring life to the static player sprite, There are quite a few animations to go through, but I’ll share importing the idle as a refresher and it has all the steps needed for a reminder:

Open Unitys Animation window and set it into the game scene area.

Then select the players sprite object, and in the animation window click on “create animation”. Save it in the players sprite directory under animations as “player_Idle” or something similar.

I don’t think we need the tile palette anymore so I’m going to close it to give room to the animator.

Much better! Now if you look into the Animation director, there’s the PlayerIdle that we still need to populate with animation frames, and in the inspector, in the Animator section, we see an Animation controller named Sprite. This is the controller that’s being used in the player sprite now and if you double-click on it, it will take you into Mecanims animator( or you can always open the Animator Window manually, there’s more than one way to do most things in Unity!) which we’ll be getting more into later.

Putting the animation into the player is actually pretty easy, just drag all of the sprite frames into the animation window. Give Unity a few moments to process everything and then you’ll be able to press the play button and see your player in action!

It’s playing at around 60fps which is a little too fast. Let’s halve that to 30fps.

That’s a lot better!

Adding a new animation is a lot easier now that the animator is set up. Just go into the animation window, and with the player sprite selected, hit the drop-down menu where Player_Idle is and select “Create new clip”, in this case, we’re going to make Player_Run and save it in the same Animation directory.

If you check the Animation window, you’ll see that it’s created a Player_Run state as well.

And that’s pretty much all there is to it! There are more animations to put in like run, attack, jump, etc. And you implement them all the same way, so once you know how to go through these steps, you’ve mastered the process of animating sprites in Unity! This is of course only one step. We got the animations in, but now we need to make transitions between them! Stay tuned, we’ll learn all about that tomorrow!

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Recommended from Medium

OPA, Styra and Terraform: protect your cloud

Refer the Bimp airdrop and get more Bimp tokens in your pocket

I think that publishing online is a great way to express developer’s opinion and current affairs…

The Bookshelf App; A Sinatra Web Application

Antique hardcover books in various colors sit in a bookshelf

Rewriting your git history to share concise, readable changes

Building end-to-end MVPs without code 💡

Continuous Integration & Deployments at Syfe

Different ways to validate requests: Spring WebFlux RouterFunctions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Esteban Ibarra

Esteban Ibarra

cartoonist, game artist, and wanabe gamedev.

More from Medium

Using Signal Emitters in Timeline to Access C# Scripts

Rendering Pipelines in Unity

Eyesight in Unity

Unity Feature 101: Resources Class