Int UK 875 Folder Collection
After playing the video, you can click or select the word to look it up in the dictionary.
Loading...
Report Subtitle Errors
Hi! My name is Gustavo Carvalho from Contra Labs
And this is how to make sprite animations with Unity 4.3
Using 2D native development
So, let's get started
Let's create a new project
I will make it "Animation Sprite 2D"
And here I will use nothing of this
But I will set up defaults for 2D
And "Create Project"
So, now we have this 2D option over here
Where we can see the scene in a 2D way
We have our camera, which must be set to 'orthographic'
Because you are dealing with 2D
Let's put a new sprite here
Unity 4.3 has this new kind of object called "Sprite"
Which contains the "Sprite Renderer"
Now we must create the images that will be used by our sprites
Let's create a folder called "Sprites" and put our sprites there
We can put the sprites separately or we can use a sprite sheet, like this
I will use this sprite sheet over here, let's make it into sprites folder
This is a kind of "Sprite"
The Sprite Mode is "Multiple" because I'm using a sprite sheet
And I can open the Sprite Editor to choose each one of the sprites I will use
So, before this I got this warning telling me that if I use a compressed texture
it will give imperfect results
So I will change the mode from "Compressed" to "Truecolor"
And Filter Mode I will change it to "Point"
If you are a beginner probably you want to use this as well
But if you are advanced you can choose better your configurations
So now open you Sprite Editor
Let's choose here...
Still got this warning because I think I did not apply this
I can open the editor again and slice it automatically using the automatic mode
I can use Minimum Size of 10 pixels because I know that every image I have
Is at least 10 pixels wider or taller
And the Pivot point I will use the bottom
I got this sliced and here I have all my images separately one by one
I can edit the options of each one, move the pivot or size
The pivot is this little ball, I can put whatever I want
I will leave at the bottom
"Apply" and now I have each one of the images separately
Now all I have to do is select my sprite object
That I created here and move the selected animation frame that I want
So for now I want it to walk so I will select this sprites and move it
To animation screen
I will put a name for my animation - Walking
And I will save it in a new folder called Animations
Save it. If you don't have the Animation window you can open it in Window -> Animation
So now you have this.
So if you go to you scene view you can see your sprite over here
And if you play it, it is animating but it is too fast, so you can
adjust the speed of animation to 12 and now looks better
And that is the way you do sprite animation in Unity
If you don't have a sprite sheet like this you could use separated images
It work in the same way, just select the images and drag and you have the animation done
But, how you can do separated animation?
If you go here in Animations (folder) it created an Animator called "New Sprite"
Which controls the animations and we have this specific animation which controls the walking
Now, if you go here and create a new animation (New Clip)
Let's say... "Running"
I will save it here as well
Now I have our Running animation and will configure this
running animation to use this sprites over here
So now i have a running animation and I have a walk animation
Walking and running
Here again I will change the speed to 12
And now it looks better
But, how can I change from one animation to another?
If I open here the New Sprite it will open a Animator window
And as you can see we have a Running and a Walking state
So the start state or the default state is that orange one
And from here I can choose to go to other states of animation
The way I can do this is make a transition and I have to configure
what makes this transition, what conditions trigger the transition
Now I only have this condition, "Exit time", so when this first animation is done
it goes to the next animation. But if I use some parameter here
I could create any parameter here
For exemple, "StartRunning", so now that I have this parameter I can go into the code
And say that animator.SetParameter("StartRunning", true);
So when the code tells the animator that StartRunning is true, then the transition will happen
But for now I will just use the Exit Time
But let's suppose I don't want the Walking running only once, I want it run twice
So after it run twice the character can "Running"
So let's test it to see if it is working or not
So now, as you can see, it is running, but I didn't see the transition
Let's start over. I think the transition from walking is too fast
But if you go really slow you can see it starting in walking and then
Moves to Running
And that it. A simple way to do sprite animations with Unity 4.3
Bye
    You must  Log in  to get the function.
Tip: Click on the article or the word in the subtitle to get translation quickly!

Loading…

Unity 4.3 2D Sprite Animation

875 Folder Collection
朱瑛 published on May 2, 2014
More Recommended Videos
  1. 1. Search word

    Select word on the caption to look it up in the dictionary!

  2. 2. Repeat single sentence

    Repeat the same sentence to enhance listening ability

  3. 3. Shortcut

    Shortcut!

  4. 4. Close caption

    Close the English caption

  5. 5. Embed

    Embed the video to your blog

  6. 6. Unfold

    Hide right panel

  1. Listening Quiz

    Listening Quiz!

  1. Click to open your notebook

  1. UrbanDictionary 俚語字典整合查詢。一般字典查詢不到你滿意的解譯,不妨使用「俚語字典」,或許會讓你有滿意的答案喔