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 DeeRyeUs · Jun 13, 2016 at 12:43 PM · animationandroidanimatorunity 2d

Can't get my Unity 2D animation to play properly

I created animations from within Unity using a multiple sprite sheet where all the body parts were separate and assembled into the scene. I have a Player object with a child for each object for the player facing up, down, left, and right, with children for each object for their body parts facing those directions. The objects for each instance of the character are stacked on top of each other in the scene.

Using blend trees for idle and walk animations, I was hoping to smoothly transition between animations. Perhaps since each directional character exists in the scene under one parent, I can't seem to deactivate individual objects of a directional character on starting the game. Using animation to deactivate the other objects for when the current character is animating produces this funky result:

https://youtu.be/RoV8GZtVeoI

The overlapping doesn't occur if I set transition time to 0, but it's not the effect I'm aiming for. How can I get this to work, or how can I build my animations to prevent this from happening in the future?

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

Answer by Dibbie · Jun 14, 2016 at 08:30 AM

It may be easier to have your animations on one sprite and create "frames" instead of animating different sprites.

Though with your issue here, since you are trying to hide objects when your character stops, sub-child them in your parent instead. So you you may have a higherarchy that would essentially look something like: Character UP_CharacterHead UP_CharacterNeck UP_CharacterTorso ... LEFT_CharacterHead LEFT_CharacterNeck LEFT_CharacterTorso ...

And so on...

Then you can just "hide" for example, "LEFT_CharacterHead", which would also hide all the children to that - but that all exists under your generic "Character" sprite, which your body parts are built up of.

Comment
Add comment · Show 2 · 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 DeeRyeUs · Jun 14, 2016 at 10:46 AM 0
Share

With this particular case, do you mean something along the lines of having each individual body part for each direction inside one single parent object?

Could you also describe more about the "frame" creating idea? I am very willing to try other methods to solve this. Anything along the lines of having one player character that can be animated in four different directions using individual pieces.

Thanks for the input!

avatar image Dibbie DeeRyeUs · Jun 14, 2016 at 06:18 PM 0
Share

Yes, thats exactly what I mean - youd have 4 parent objects inside one master parent object in a way.

The more common alternative, is putting your sprites in one image. So you would create a PNG image of your character "constructed" ins$$anonymous$$d of doing it in Unity, youd do it in something like Photoshop or an image editor. Youd create the facing directions there, so when you save it, ins$$anonymous$$d of saving "Character_LeftArm", and so on, its all in one image, youd save it as "Character_LookingLeft" etc...

Back in Unity, you can then take that image to represent your player, and when moving left or right, you could either "flip" the image with Unity's built-in method for that on Sprites, or hide Character_LookingLeft, and show Character_LookingRight, for up and down same kind of idea.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity 2d, Need help with Player Sliding when Swiping Down 0 Answers

How can i pay a animation again and agan? 1 Answer

How to play one animation single time and then loop second animation? 0 Answers

How can you cancel the current animation? 1 Answer

Android Performance with 2d BoneBased 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