Search Unity

Animation clip works great in editor when playing but not in a built project

Discussion in 'Animation' started by GeoffCoope2, Mar 18, 2015.

  1. GeoffCoope2

    GeoffCoope2

    Joined:
    Apr 18, 2013
    Posts:
    9
    Hi

    Using Unity 3.5 Pro.

    I have an animated skinned character imported from 3dsmax with an animation clip of him performing an action using the following code:

    Code (csharp):
    1.  
    2. wsoStopCharacter.animation.Play("Take 001");
    3. yield WaitForSeconds(10);
    4. wsoStopCharacter.SetActiveRecursively(false);
    5.  
    And later when the camera comes back into this area I unhide the character and rewind and play his animation clip with...

    Code (csharp):
    1.  
    2. wsoStopCharacter.animation["Take 001"].time = 0;
    3. wsoStopCharacter.SetActiveRecursively(true);      
    4. wsoStopCharacter.animation.Play("Take 001");
    5.  
    This all works great when I play in the editor but in a Windows or Mac build the second time I call his animation he is invisible. The camera is just looking at the spot where he should be.

    I have checked that the camera isn't using a culling mask.

    I can't figure this out. Works in great in editor, but doesn't work in a built project on either windows or mac.

    Any help would be much appreciated.

    Thanks