Player Animations Setup
00:00:00:04 - 00:00:27:26
Peter
In this video, we are going to add idle and movement animation for our player character in our project. If we go to our project stub and select our underscore arts sounds and assets, we can go to the spiritual world by gift to the characters. And here we can to those sprites representing our character. We have discussed that. I have prepared that this girl of short being her as our character.
00:00:28:02 - 00:00:54:13
Peter
If we select the third follow character to animation and select the Sprite editor button, we can see that we have a couple of additional animations for this character. The first four rows are representing a simple walk animations since I used it to create the remaining animations. The next four rows represent the swinging animation, so we are carrying some tool and we are swinging it.
00:00:54:19 - 00:01:16:20
Peter
It will work for our hotel. It could also work for a peacocks or an ax. So this should be pretty universal animation for us. And next, photos are for moving while caring something so we can have the hands up and we are moving. So this is one additional animation. Obviously, we could use the first frame of each of those to have the idle animation.
00:01:16:28 - 00:01:39:22
Peter
I think to set middle frame, to have the idle animation for carrying something while standing still. And the last four rows represent watering animation. So we are holding a watering can and we are using it in front of us. So this is for the purpose of being able to water crops. So this will be an important part of our farming game mechanics.
00:01:40:00 - 00:02:05:11
Peter
Again, this is already sliced. We have those cells 16 by 20. And again, I have used the same method as previously. Like the nice button and sliced those. It is already prepared for you. Also in the inspector the settings are already applied to for EMT to treat this as a pixel art asset. First thing that we need to do is prepare animation clips for our layer for idle and movement animation.
00:02:05:23 - 00:02:29:25
Peter
We want to find our agent prefab, so I'm going to select from the favorites our prefab folder and select agent. And here we have this agent render and agent mover. Now we are going to place our animations, our animator. So the component that will play our animations, all the agent render this we need to affected this sprite render component in turn.
00:02:29:29 - 00:02:50:12
Peter
So now select again our art and sound assets separate to world character Park. We are going to select our atlas. Let's use this out expanded and we are going to use the slider to increase the size of this. And here we are going to search for our girl with being short, Huh? And here is our movement animation downwards.
00:02:50:23 - 00:03:11:08
Peter
We're going to select all those three assets, select the first one and hold shift to select the last one. So those are our three sprites and we can drag those onto our agent renderer and a new window will appear. It will ask us where to save the asset off type anim. This will automatically create for us the animation and clip.
00:03:11:16 - 00:03:37:22
Peter
I'm going to call it move down. So underscore down. And I'm going to save this. Now, if I slide up in this folder, minimize the atlas and minimize the look of the folder we're going to find here, Agent Render an asset, which is an animator component as well as our move down, which is an animation clip. What we can now do is exit our prefab.
00:03:38:03 - 00:03:55:17
Peter
Let's save this. And if we press play, we're going to see in the game view and in the scene view that our animation is being played, although it doesn't look that great. But we have the animation playing. We will add the idle animation in. Then next the video.