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
2
Question by dominikusdp · Apr 04, 2017 at 04:58 AM · animatoranimator controller

Unity 5.6 Animator.Rebind doesn't work - Animator doesn't reset on disable & re-enable gameobject

Hi, just migrated to Unity 5.6 today.

On Unity 5.5.2, when gameobject with animator is disabled then re-enabled, i can expect the animation is reset. And I am taking that advantages in my game so much. In 5.6 the behavior doesn't like that and I tried to manually call the Animator.Rebind(), it doesn't do anything.

Anyone has same problem ? Or anyone has already had solution ? Thank you.

Comment
Add comment · Show 4
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 pep_dj · Apr 04, 2017 at 02:43 PM 0
Share

I'm having the same issue :(

avatar image gkngkc · Apr 04, 2017 at 03:17 PM 0
Share

İssue tracker link: https://issuetracker.unity3d.com/issues/animation-transition-from-entry-node-to-a-default-state-not-happening-after-disabling-and-re-enabling-gameobject-during-playmode

avatar image marf · Apr 08, 2017 at 08:21 PM 0
Share

Same problem here! When version 5.6.0p1 will be released with the fix? All our animators are broken since the update to Unity 5.6.0f3

avatar image Andrey-Postelzhuk · Aug 16, 2018 at 11:37 AM 0
Share

Have same bug in the Unity 2017.3.0f3. Here is a workaround: https://forum.unity.com/threads/losing-animator-state.307667/#post-3598984

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by SaintGrey · Apr 25, 2017 at 05:12 AM

Try this:

  Animator.enable = true;
  Animator.Play("your entry state", 0, 0f);


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 artplayer · May 15, 2017 at 01:21 AM 0
Share

This worked for me. Thank you!

avatar image
0

Answer by SaraCecilia · Apr 06, 2017 at 08:13 AM

Hi, this should be fixed in 5.6.0p1.

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 Jix · Apr 11, 2017 at 08:39 PM

The solution that worked for me is when an object gets disabled I do something like this

 OnDisable()
 {
      Destroy(myAnimator);
 }

And in OnEnable()

 OnEnable()
 {
      if(myAnimator == null)
      {
           myAnimator = gameObject.AddComponent<Animator>();
           myAnimator.runtimeAnimatorController = myPrefab.myAnimator.runtimeAnimatorController;
           //Don't forget to set applyRootMotion and the avatar if needed
      }
 }
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 impurekind · Sep 23, 2018 at 11:52 PM 0
Share

I don't understand how and where you create, set and store the prefab for an animator controller and all the stuff in it and to do with it, such as assigning the actual animation controller you've created in Unity's animator to the animation controller component on the object, such that you can assign that to the animator component that you've just created in code when the object is reactivated again?

I mean, I get the first part where you add an animator component to an object you've just activated if one doesn't exist already, but anything after that is a mystery to me.

avatar image gareth_untether · Mar 18, 2019 at 09:05 PM 0
Share

Totally lost with:

 myAnimator.runtimeAnimatorController = myPrefab.myAnimator.runtimeAnimatorController;



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

13 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

Related Questions

What's the best practice for setting up different character animations for different weapons? 0 Answers

IK Targets are not working 1 Answer

Animator problem in Create with Code. in Unit 3 1 Answer

Moving an animated object's animator instead of the object? 0 Answers

OnCollision2D stopped working 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