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
1
Question by Knnthra · Dec 13, 2015 at 02:47 PM · c#animationwebglstate-machine

Unity 5.3 WebGL StateMachineBehaviours not executing.

I just updated to Unity 5.3, and decided to update one of the games on my website to the new WebGL build. When I tested the game, some of the functionality didn't execute. After a lot of debugging I narrowed it down to the functionality inside the StateMachineBehaviour scripts(its a 2D game).

for example: If I make a behaviour like this and attach it to an animation, then the object is destroyed while playing it as a standalone build or in the editor. But if I export it as a WebGL build the object isn't destroyed after the animation has finished playing.

 override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
     {
         Destroy(animator.gameObject);
     }

Has anyone else experienced this, if so then I guess it needs to be reported as a bug.

EDIT: I have been in contact with the Unity bug report team, and I just recieved the following message:

Hey,

We have been able to reproduce this bug and have sent it for resolution with our developers.

We highly appreciate your contribution. If you have further questions, feel free to contact us.

Regards, Stefan

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 Bunderant · Dec 14, 2015 at 05:58 PM 0
Share

State$$anonymous$$achineBehaviors are broken for me in Unity 5.3 on iOS, maybe related. I get an error in XCode saying, for example, "OnStateEnter() cannot take parameters", but the build won't compile without the parameters in the override. I need to file a bug report, but I'm in crunch mode at the moment. Had to rip what little $$anonymous$$ecanim we had in our project out, because we can't revert to an earlier Unity version.

avatar image AlainD Bunderant · Dec 15, 2015 at 04:32 PM 0
Share

Can't say about WebGL but I do have the save problem as Bunderant : State$$anonymous$$achineBehaviour.OnStateEnter() is never called on iOS (though it works fine in editor and on Android). So I guess it does deserve a bug report. :)

avatar image arspermeable · Jan 10, 2016 at 01:24 AM 0
Share

I had the same issue on webgl, and after a lot of time debugging and narrowing down I reached this post. Any idea? I am running 5.3.0 but probably 5.3.1 will have the same behaviour since it was issued on Dec 18th, just 5 days after your question, and there is nothing related to state machine behaviours in the fixes list.

As a workaround, I got it working substituting the OnStateExit by an animation event in the last frame of the animation. Of course, this is not useful if the animation is a loop, but for me it worked. If you can see any regret in this workaround or can figure out any other approach, I'll be glad to listen.

avatar image arspermeable · Jan 11, 2016 at 03:22 PM 0
Share

Hi! After really long time debugging my stuff, I reached the same conclusion and ended up in this post. Any update? I am running 5.3.0f4 and the last version is 5.3.1, dec 18th, 5 days after your post and there is nothing on the fixes list related to this.

Did you find any workaround? I thought about adding an animation event in the animation itself ins$$anonymous$$d of a behaviour to the state, which sound weird but, at least in the editor, it works.

Any help welcome. efraim

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Max Pushkarev · Jan 25, 2016 at 04:43 AM

Hi! I faced the same problem with StateMachineBehaviour in my project. I noticed that in WebGL you can avoid this bug by switching off "Code Stripping" option on PlayerSettings. This helped me.

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 Deepscorn · Jan 27, 2016 at 03:53 PM

I faced same bug but on IOs. I found several options, that can be used right now:

  1. Disable "Code stripping" in player settings, as already proposed by Max Pushkarev

  2. You can install patched Unity 5.3.1p3 or newer. Bad news - it is said, that patches don't work for WebGl

  3. Downgrade. See bugs below. It is said that bug is not reproducable on some 5.2.x versions of Unity

Bugs:

https://issuetracker.unity3d.com/issues/webgl-statemachinebehaviours-not-executing https://issuetracker.unity3d.com/issues/stripping-statemachinebehaviour-overrides-not-called-on-ios

PS Bug will be fixed in Unity 5.4. But it's release date is march 16, 2016. So it is a long wait. I'm using 5.3.1p4 right now and for my IOS build all is good

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Mouse move to control the animation 1 Answer

How to start Animation left turn With the cursor 1 Answer

why I have to anim.getComponent in update() function when I had done in Start () function 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