![walks left unity pc build walks left unity pc build](https://images-na.ssl-images-amazon.com/images/I/71nwgZxGTlL.jpg)
Slicing the sprite-sheetĪgain in the Inspector window, click the Sprite Editor button. Now Unity knows treat player.png as a sprite sheet with multiple frames of animation.
![walks left unity pc build walks left unity pc build](https://blog-api.unity.com/sites/default/files/styles/focal_crop_ratio_16_9/public/2018/11/unity-editor-subNest.00_00_12_25.Still001.png)
Click the Apply button in the Inspector tab. In the Inspector window change the Sprite mode option from Single to Multiple. Browse to the player.png image you just downloaded and click the Import button. Right-click in the project tab and select Import New Asset…. This isn’t necessary to complete the tutorial. Note that in the image at the top of the page I have added a pretty background.
#WALKS LEFT UNITY PC BUILD CODE#
However, if you are kind enough to help spread the word about this tutorial, there is a nice little download that contains the code and the graphics in one handy zip file.ĭownload this sprite-sheet which contains all the frames of animation for a simple walking animation. For this tutorial, it is convenient to disable this behavior.Īll the code and graphics that you need for this project are contained on this page.
#WALKS LEFT UNITY PC BUILD FULL#
In a full game, we would almost certainly leave gravity enabled and provide a level for the player to jump and fall around in.
![walks left unity pc build walks left unity pc build](https://img.itch.zone/aW1nLzMxODUzNjYucG5n/347x500/Rxlqlx.png)
In the RigidBody 2D component set the Gravity Scale to zero and check the Freeze Rotation option. So we can eventually move the character add a RigidBody 2D component as well. Be sure to choose Animator and not Animation. Make sure the Player object is selected in the Hierarchy tab and click the Add Component button in the Inspector tab. Right-click in the Hierarchy tab and select Create Empty…. Creating a game object and adding an Animator componentīefore we move on to the animation proper, we need a game object in the scene. It doesn’t really matter where these tabs are added because they will work anywhere and you can easily re-size them to accomadate whatever you are doing. We will see the difference between these simmilarly named tabs as we proceed. Now select Window | Animator to open an Animator tab. In the main menu select Window | Animation to open an Animation tab. Before we get started adding our sprite-sheet to the project, we will need some animation-specific tabs open in the Unity editor. Name your project Sprite-sheet animation, select the 2D option and click the Create Project button.