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
2
Question by wiiarethesound · Aug 22, 2013 at 04:46 AM · animationsetactiveisplaying

Animation stops playing after disabling and enabling game object

Basically, the short version is that I call gameObject.SetActive(false) on a game object when I pause the game and then gameObject.SetActive(true) when resuming. For some reason this stops all animations on the game object. I am not calling animation.Stop(), or any other animation functions. I tried debugging and the isPlaying flag on the Animation component is getting set to false. Animations will resume when there is any kind of input. Any ideas on why this would be happening?

EDIT: I should note that I'm calling gameObject.SetActive(true) on the parent object, and the Animation component is located on a child of that object.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Paulius-Liekis · Aug 22, 2013 at 06:59 AM

This is by design, although I don't remember why it's implemented this way.

Comment
Add comment · Show 4 · 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 wiiarethesound · Aug 22, 2013 at 03:54 PM 0
Share

So is there a way to continue playing the animation that was already playing, perhaps using the OnEnable() function?

avatar image Louis-N-D · Aug 26, 2014 at 02:14 AM 0
Share

I would VERY much like to know this too as it's hugely interfering with my culling system (which sets parents objects of sections of my level to Active=false). $$anonymous$$y enemies rely heavily on their animations for their behaviour, so they often break completely when re-entering a zone that was previously culled.

avatar image snmt_singh · Jan 06, 2015 at 12:28 PM 0
Share

@wiiarethesound do you able to solve this problem?

avatar image perenico · Mar 19, 2015 at 03:32 PM 0
Share

I'd like to know a way too as I'm currently getting the same issue on my project

avatar image
0

Answer by sebastiansgames · Aug 02, 2016 at 12:00 PM

ah okay -- in my case this was due to the fact that my game object had a coroutine that was constantly determining the object's speed and feeding it to the animation so it knew what animation to play (i.e. run etc).

disabling the game object stopped the coroutine.

re-starting up that coroutine in OnEnable fixed this issue in my particular case.

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

18 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

Related Questions

Check if multiple gameObjects play animation 2 Answers

UI Animation Not Playing 1 Answer

How to check if an object is playing ANY animation 1 Answer

How to use one trigger that will set object active then when hit the 2nd time will deactivate it? 1 Answer

Animation plays without a bool, but after adding it just goes still 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