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
1
Question by shadiradio · Sep 20, 2014 at 10:30 AM · animation2dbuildsprites

Sprite animations won't export/run in a published build unless you play in editor first

It's a strange issue, but I've had it from Unity 4.3 and up, including the current 4.6 beta. It's a 2D game using many sprite animations, but if I just open the project and export a build, the animations won't play in the build. They just sit there frozen on the first frame. For example, the character is just sliding around. However any animation that has been "viewed" while playing in editor will from that point export fine in published builds. I really can't trust a published build, and as the game grows it seems crazy that I would have to run through the entire game making sure I've "seen" every animation before publishing a build? Is anyone else experiencing this bug?

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
0

Answer by grrlgglglr · Sep 27, 2014 at 06:53 PM

Same problem here, I can confirm that on Unity 4.5.3. I'm unable to figure out why this happens, but it looks like only objects that start out disabled suffer from this. Also, interestingly, not only does the animation freeze but rather the entire Animator component. I did some debugging and setting Animator parameters (e.g. with SetFloat) and reading them back (`GetFloat`) doesn't even return the correct value, which is just frozen.

If you only had a handful of objects you should be able to work around this by making the object transparent or disabling only the sprite renderer, which is what I did for lack of a better solution.

However, if you really have many sprites as you mention, this workaround is kind of infeasible.

It's not much, but hope that helps, maybe someone will shed light on this soon since it's a rather serious bug.

UPDATE: From what I could gather, the problem comes down to transitions in Mecanim. For some reason, if you ever add a transition between sprite animation in an animation controller, it will break forever, even if you remove the transition afterwards. So another possible workaround would be not using state transitions ever and handling animations entirely in behavioral scripts. I'll get to working in a script that makes this a little less painful to manage until it gets fixed.

Comment
Add comment · Show 3 · 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 shadiradio · Sep 27, 2014 at 10:15 PM 1
Share

Thanks for the input grrlgglglr, that at least is something to possibly look into to, though definitely a workaround. I am pretty surprised that I don't hear a lot about this, as it directly affects your final builds and is pretty much a showstopper. The fact that I haven't heard much about it led me to think that it was some kind of local issue I was having with my project specifically - but it's interesting to hear that you've noticed the same thing.

It's very scary to publish a build. Even a quick smoke test after publishing is not enough to verify its integrity. Hopefully Unity knows about this. I tried contacting them about it a long time ago, figuring it would be sorted out later in my development, but it's been a very long time with no response. I'll look into some hacks...

avatar image grrlgglglr · Sep 27, 2014 at 11:33 PM 0
Share

I think it must be something weird about the setup, since it doesn't seem to be widespread. Are your sprites, by any chance, pretty far away from the camera and/or really large? I've found it only affects some of my sprites and maybe we have something in common there.

Also, it looks like the sprite disappears altogether if it's in a scene which isn't open in the editor at the time of building. $$anonymous$$aybe there's something broken in SpriteRenderer?

avatar image shadiradio · Oct 18, 2014 at 03:33 AM 0
Share

Hmm that is troubling. I definitely use $$anonymous$$ecanim to transition states for my sprite animations. However it also happens for some of my sprites that don't use $$anonymous$$ecanim as well. None of my sprites are particularly far or at crazy distances. I wonder what the root of this is...

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

2d sprite animation issue 2 Answers

How to swap sprites? 1 Answer

Animating hair over sprite animation 0 Answers

Lighting an Animated Player 0 Answers

2D sprites animation is not working - using tiled texture extended. 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