Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by jakejolli · May 20, 2016 at 03:58 PM · animation2dspritesbones

Animating a Sprite from Parent Animator

I've created a 2d character for my game that uses both bone based animation and frame-based spritesheet animation.

For most of the different parts of my character, attaching an animator directly to the component (Hands, Head, etc.) and animating the sprites directly on the same GameObject works fine. However, in order to sync the sprite animation of the body with the walk/run cycle (which are bone based animations), I have to animate the body's sprite from the parent game object (which animates the arms and legs for the walk/run cycle).

However, I'm unable to add the 'Sprite' property of the child (the body) to an animation in the parent (a mostly empty gameobject holding a hierarchy of 'bones' for the character).

Typically, when wanting to animate a property of a child, I expand that child's hierarchy in the animation window and click the 'plus' button next to the desired property. However, this plus button is missing from the 'Sprite' property:

alt text

I have, in desperation, tried dragging the sprite directly into the animation, but it just adds a sprite renderer to the parent.

How can I accomplish this?

snip.png (17.9 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by FortisVenaliter · May 20, 2016 at 04:51 PM

You shouldn't use multiple Animators, you should use one on the parent, and add the parts that need to be animated separately to their own layers in the AnimatorController.

Comment
Add comment · Show 3 · 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 jakejolli · May 20, 2016 at 06:03 PM 0
Share

I forgot about animation layers. I've never used them, but, depending on their capabilities, it might seem that this would be the solution.

Would animation layers allow animating the 'bones' of a character for a run cycle and animating the sprites of a hand in a cycle which is independent of the walk cycle, and having both animations play at the same time?

avatar image FortisVenaliter jakejolli · May 20, 2016 at 06:06 PM 0
Share

Yup. Indeed they do.

avatar image jakejolli FortisVenaliter · May 20, 2016 at 06:29 PM 0
Share

Without this answer, I never would've figured this out, but I should add more information for anyone encountering this problem in the future:

After removing the animator from my body, I was able to select the parent object in the inspector, add the sprite property of the body to the animation, select the body in the inspector (while still having my animation persist in the animation window) and switch out the sprite for the body in the inspector after selecting the appropriate frame in the animation window.

Works like a charm! Thanks!

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

103 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2d Animation sprites - right way? 0 Answers

Lighting an Animated Player 0 Answers

How to swap sprites? 1 Answer

2d sprite animation issue 2 Answers

Animating hair over sprite animation 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