Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Alaro · Oct 15, 2011 at 06:35 PM · animation2dmovementsprite

Sprite animation

Hey, i'm currently trying to develop a game made out of sprites, and i need alittle help on the sprite ¨main character¨ movement, So i was wondering if someone could try to explain how i'm supose to make the sprites change ¨animation¨ for which way i'm walking ( its a 2D game and i have spritemanager2 )

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by MrSplosion · Oct 15, 2011 at 06:57 PM

It's really simple you just make a big sheet with each frame of you sprite's animation. Then tile it so that only one frame is showing at a time. Then from there you just increase or decrease the offset to show the next frame.

Sorry, it's kinda hard to explain but this tutorial should get you on the right track.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BadSeedProductions · Nov 30, 2015 at 11:34 PM 0
Share

Youtube link is no good

avatar image
0

Answer by SirWeeble · Dec 01, 2015 at 10:25 AM

There are a few ways to do it, but the Animator tab is the best way.

You can create a sprite sheet by selecting the import type "Sprite" then instead of "Single" select "multiple", which will let you input how you divide up your sprite sheet. It's easiest with a grid. The editor will then re-import your sprite and divided it up for you into names like "MainCharacter_0, MainCharacter_1, MainCharacter_2" automatically, corresponding with the sprite sheet.

Then, a quick way to create a new animation is to highlight and drag the numbered sprites onto your GameObject which needs the animations. That will create an Animation object in your project tab and give the GameObject an Animator. If you open the Animation tab and select the object, you can edit the new animation, swap around it's frames, etc.

You can also manually give an object an animator, and create new animations inside the Animation tab by dragging the frames into the time-slider.

Once you've got a few animations set up, you can control which conditions control which animation you need to play. So for example, you can connect your running animation to a Boolean "isRunning".

In your animation-controller script, you can use

 if( characterisMoving)
 {
 transform.GetComponent<Animator>().SetBool("isRunning",true); 
 }
 else
 {
 transform.GetComponent<Animator>().SetBool("isRunning",false); 
 }

and your character will play it's running animation. Set it to false, and he will stop. You can control the logic flow in the Animator tab.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Animator warning in editor, animation is preventing script from working 1 Answer

When i make my character animated, he can only move up, down left and right (2D) (JS) 0 Answers

SpriteManager 2 1 Answer

Beginner using the animation controller to get a sprite walking left and right..Need some help going from here 0 Answers

Simultaneous Animation for an Object 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges