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 YJack · Sep 23, 2013 at 04:59 AM · 2dmecanim2d animation

Instant transition with Mecanim (Unity 2d)

Hello guys, I`m using mecanim state machine with Unity 2D. I have several 2D elements that is supposed to play in sync (character with different eyes, hair and cloth possibilities). I set my transitions blend to 0 size and tryied with atomic option enabled and disabled (I`m not sure what this could help but I saw something about this here)

Im not using ExitTime because I want the transition occurs in the exactly call from a trigger (the exactly frame). However Im getting about one frame of difference between my animated sprites (believe me, some parts of the eyes need to move without any delay or something very odd happens)

I put a trivial example below (A one state animator trigged by a boolean called dance).

Trivial Example

I set my trigger in a simple code as the one below (Unityscript):

 var childAnimators : Component[];
 
 function Start ()
 {
     childAnimators = GetComponentsInChildren(Animator);
 }
 
 function Dance ()
 {
     for(var littleAnimator:Animator in childAnimators)
         littleAnimator.SetTrigger("Dance");
 }


transition.jpg (116.4 kB)
Comment
Add comment · Show 2
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 RChrispy · Jan 13, 2014 at 03:29 PM 0
Share

I think I have the same problem :(

Somehow Unity always resets the instant transitions to like 50% if the current animation.

I dont know why that is teh case. $$anonymous$$aybe its a Bug or it's intended. Searching the web didn't give any clues...

So an instant switch of the Animations in the first frame is not possible?...

avatar image rcober · Jul 12, 2014 at 03:14 AM 0
Share

Have same problem - no instant transition. And changes to the ti$$anonymous$$gs in the transition window don't stay - always revert to like 50%....

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by uacaman · Feb 20, 2015 at 01:45 AM

Delete the ExitTime and the transition will be Instant

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
avatar image
1

Answer by Clopay · Jan 15, 2014 at 06:57 PM

For animation transitions, I've had a bit better luck with scripting (C#); however, while scripting the animation made an improvement with the animation transition issues, it brought a new set of challenges for me.

I've got a sprite sheet from which I derive multiple animations. So far each animation is only 2 frames. I have each frame last 0.5 seconds for an animation lasting one total second. My problem in using the animator controller was instantaneous transitioning (or lack thereof) from one sprite animation to the next. If I'm walking and I jump, if I'm falling and I land, or some other transition, it needs to play out the entire frame before it transitions. That's a minimum of a 0.5 second lag. The different features in the transition property don't seem to do much - I have not seen a change yet whether "Atomic" is checked or not. Perhaps I'm not using it right?

The "Any State" animation box is very useful, but is limited as far as player states. Transitioning from "Any State" to another state allows your animation to transition immediately; the problem arises when you need to transition from one state to another - neither of which are "Any State."

I have tried scripting it. The scripting seemed to work a bit better - when I went from idling to walking, the walking animation would cut off the idling animation as expected, and so on. This was pretty easily done - I simply added an Animation.Play("Idle") in the code. That's it. But eventually my code became so chaotic and buggy that I had to reduce it, and that meant cutting the animation out.

I have yet to dive into Unity further, but these are my experience so far. Everything is working amazingly and is far better than having to write out an entire script dedicated to animating your sprite sheet. I just wish I could figure out how to transition instantly in the animator!

Hopefully one of my attempts can enlighten you as to working towatds a solution!

-Clopay

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
avatar image
1

Answer by Shifty-Geezer · Jan 17, 2015 at 08:15 PM

Just found if I use an exit time of 0.01 instead of 0.00, it instantly transitions. An exit time equal to zero is possible a special case to use the full length of the (longest?) clip.

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
avatar image
0

Answer by MJonee · Nov 01, 2014 at 01:35 AM

I'm using triggers to change animations, but also using exit time with 0.0. If I used only triggers, then the time reseted to 50%. Using exit time with 0.0 fixed it.

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

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

How to lock movement for a character while attack animation using "while" function? 2 Answers

Stuttering in simple 2D game using interpolation? 1 Answer

2d Animation sprites - right way? 0 Answers

Cant get rid of animation delay in Mecanim 2 Answers

Moving Platform issue 1 Answer


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