Search Unity

AddMixingTransform does not work, why?

Discussion in 'Scripting' started by hizral, Jan 20, 2014.

  1. hizral

    hizral

    Joined:
    Apr 27, 2010
    Posts:
    568
    Hello there, would like to know whats wrong with my script. I tried to used AddMixingTransform for my character. Would like to make my character idle and wave at the same time. But when I used AddMixingTransform it just move my character left hand to wave but the other body part does not move at all. what is that.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class NewBehaviourScript : MonoBehaviour {
    6.    
    7.     public GameObject upin;
    8.     public Transform shoulder;
    9.    
    10.     // Use this for initialization
    11.     void Start () {
    12.         upin.animation ["wave"].AddMixingTransform (shoulder);
    13.         upin.animation ["wave"].layer = 5;
    14.     }
    15.  
    and when I do it like below it does not read the wave animation. it just play the idle.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class NewBehaviourScript : MonoBehaviour {
    6.    
    7.     public GameObject upin;
    8.     public Transform shoulder;
    9.    
    10.     // Use this for initialization
    11.     void Start () {
    12.         upin.animation ["wave"].AddMixingTransform (shoulder);
    13.         upin.animation ["wave"].layer = 5;
    14.     }
    15.    
    16.     // Update is called once per frame
    17.     void Update ()
    18.     {
    19.         upin.animation.Play ("idle");
    20.     }
    21. }
    22.  
    23.  
    what did i do wrong.
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Do you need to add true to the call, for recursive? Or is it true by default

    And why not just use mecanim, this is pretty much what avatar masking does
     
  3. hizral

    hizral

    Joined:
    Apr 27, 2010
    Posts:
    568
    yup i need to put a true / false statement..solved it, dont have mecanim because i on ly have unity 3.5.