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
0
Question by teomaragakis · Apr 16, 2014 at 03:54 PM · animation2dsprite

Extra frame in simple animations?

I am new to Unity and for my first experiment, I decided to go with a demo of Link from Zelda running around.

For now I am only having the character idle or walk around, with 4 animations for each (idle_right, idle_left, ... , walk right, walk_left, ...). I created 2 sub-state machines (Idling and Walking) and moved the related states which I got from my animations in there.

In order to avoid a billion connections in the Animator, I added two extra empty states called walking and idle. Each one of those transitions to its substates, so walking connects to the four walking animations and idle connects to the four idle animations). Instead of cross connecting each idle animation to all walking animations, I connected them all to walking and vice versa.

In other words, each empty state leads to related non-empty states and each non-empty state leads to the un-related empty state. The rest is done with the parameters walk (bool) and direction (int). I thought it was pretty smart when I did it. If walk is false, any walking animation transitions to the idle animation, which then switches to one of the idle animations, depending on the direction.

My issue is that this extra split second that the animator stays within the two empty states, the sprite set within the layer's sprite rendered appears. If I remove the layer's sprite completely, for that split second, the character disappears.

Now it's too fast, but it's still visible. I tried changing the empty states' speed to 1000 in the Inspector but nothing happened. Can I save it somehow or do I have to connect everything with everything (which is a complete nightmare with the number of animations I'm planning to add)?

If you are curious, you can find the code here: https://github.com/teomaragakis/Walkers

Comment
Add comment · Show 7
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 Womrwood · Apr 16, 2014 at 04:43 PM 0
Share

Since you are working with sprites and your animations can sharply change to any state, I would go with legacy animations rather than using mecanim. Tip: http://answers.unity3d.com/questions/591941/unity-43-animating-spriterenderersprite-with-legac.html

avatar image teomaragakis · Apr 16, 2014 at 05:13 PM 0
Share

@Womrwood, I'm also trying to avoid this, since the Animator is really easy to use and it saves me from writing a ton of code. I'm starting small now, but the thing I'm trying to build will have a ton of animations. There must be some way.

avatar image Womrwood · Apr 16, 2014 at 05:16 PM 0
Share

If you find anything, please post it here, I am interested in solutions for these kind of problems too. I switched to legacy almost because of the same issue.

avatar image jonSG · Apr 16, 2014 at 05:42 PM 0
Share

what if you made one of the walking animations the "default walk" and used it in place of your empty walking animation.

you could still branch off to other alternative walks from it.

avatar image teomaragakis · Apr 16, 2014 at 05:44 PM 0
Share

@jonSG, tried it. The empty states do not load the default state animation, but the default sprite set in the sprite layer. So even if I add a single sprite (for instance idle_down) it will work well on transitions between down-facing animations but on the rest it will just flash an image of the sprite facing down.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

22 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

Related Questions

SpriteManager 2 1 Answer

Sprite animation 2 Answers

How to make not smooth animation? 0 Answers

Animation System in 4.3 1 Answer

How do I stop sprite animation on last frame? 2 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