Search Unity

Error playing animation (fbx and daz3d model)

Discussion in 'Animation' started by G_Trex, Sep 23, 2013.

  1. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    98
    I'm trying to put together a simple conversation system.

    So far, I just have a trigger area in front of a character. When the conversation begins, an audio file plays, the camera changes, and an animation plays.

    The sound file and camera are fine, but the animation doesn't play.

    I am using this script :

    Code (csharp):
    1.         var Obj : GameObject;
    2.         var Words1 : GameObject;
    3.         var relay;
    4.         var myClip : AudioClip;
    5.         var daisycam1 : Camera;
    6.         var daisyanimation : Animation;
    7.  
    8.        
    9.          
    10.         function Start () {
    11.          
    12.         Obj.SetActive(false);
    13.         Words1.guiText.active = false;
    14.         relay = false;
    15.         daisycam1.enabled = false;
    16.          
    17.         }
    18.         ///////////////////////////////////////////
    19.          
    20.         function OnTriggerEnter () {
    21.          
    22.         Obj.SetActive (true);
    23.         relay = true;
    24.          
    25.         }
    26.          
    27.         ///////////////////////////////////////////
    28.        
    29.          
    30.          function Update(){
    31.  
    32.            if (Input.GetKeyDown(KeyCode.E)) {
    33.            
    34.                 if (relay == true){
    35.  
    36.             Words1.SetActive (true);
    37.             audio.PlayOneShot(myClip);
    38.             daisycam1.enabled = true;
    39.             daisyanimation.Play("daisyline1");
    40.  
    41.            
    42.  
    43.                              }
    44.                          }
    45.  
    46.                      }
    47.          
    48.          
    49.          
    50.         function OnTriggerExit () {
    51.          
    52.         Obj.SetActive(false);
    53.         Words1.guiText.active = false;
    54.         relay = false;
    55.          
    56.         }
    And it gives this error :

    The animation state daisyline1 could not be played because it couldn't be found!
    Please attach an animation clip with the name 'daisyline1' or call this function only for existing animations.
    UnityEngine.Animation:play(String)
    startconv:Update() (at Assets/conv scripts/startconv.js:39)

    The animation is in the inspector however.



    Why is the animation not playing?

    Points worth mentioning :
    - This is a daz3d model
    - I made the animation in daz3d, then exported the animation only. I also baked them.