Search Unity

Mecanim crashing Unity when building game.

Discussion in 'Animation' started by Aedous, Apr 21, 2015.

  1. Aedous

    Aedous

    Joined:
    Jun 20, 2009
    Posts:
    244
    Hey all :).

    Wanted to point out something I found with building a game with Unity 5 using Mecanim that causes the build to crash Unity :(.

    I believe that the problem is when you use the "Copy Current State Machine" action, for some reason it causes the editor to crash when trying to build the game.
    I noticed this problem when I was tidying up some things to make it more compatible with different poses, I'm working on a 2D game and only using the state machine behaviour and blend trees. The editor crashed as soon as I tried to build the game to do some recording.

    I did some tests and here's what happened:

    Problem
    I first created an empty mecanim controller, just to make sure things are starting fresh.


    I then went to an existing mecanim controller which had all my animations split up into 2 sub state machines
    "InCombat" and "OutCombat", and used the "Copy current SateMachine".


    I then pasted the sub state machine into my new mecanim controller and left everything as it was to check if the build will fail, and it did.


    Then decided to try moving the inner states from the pasted sub state machine onto the base layer by simply selecting "InCombat","OutCombat","Death" and dragging them up to the "Base Layer", the build still fails.




    Solution *Workaround*
    The only way I've noticed that the build will go through successfully is if I don't use the action "Copy current StateMachine" and instead simply select the states that I want and choose "Copy".



    Then paste the states into the base layer and then hook everything up, the build actually goes through successfully, so I've found the work around, but wanted to bring this up in case anybody is running through the same issue or hasn't even noticed.
    If there is even a fix that would be really good as I can't really use the "Copy current StateMachine" action.
     
    theANMATOR2b likes this.
  2. 010hnoor

    010hnoor

    Joined:
    May 18, 2015
    Posts:
    1
    noticed this problem when I was tidying up some things to make it more compatible with different poses, I'm working on a 2D game and only using the state machine behaviour and blend trees.


    _____________
    NOOR
     
  3. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi,
    this is a know issue and has been fixed in 5.1 beta cycle, let me know if you update to 5.1 and still have this issue.
     
  4. Aedous

    Aedous

    Joined:
    Jun 20, 2009
    Posts:
    244
    Hi thanks for that, I don't have access to the 5.1 beta cycle unfortunately, but glad to know that it's being fixed, will just have to wait till it comes my way :).
     
    theANMATOR2b likes this.