Search Unity

Question The object is never moving to target

Discussion in 'Scripting' started by SharonL75, Oct 12, 2020.

  1. SharonL75

    SharonL75

    Joined:
    Aug 13, 2020
    Posts:
    91
    Code (csharp):
    1.  
    2. void OnAnimatorIK()
    3.     {
    4.       Vector3.MoveTowards(navi.transform.localPosition, rig_f_middle.transform.localPosition, 0.1f * Time.deltaTime);
    5.  
    6.     }
    7.  
    navi should move to rig_f_middle smooth slowly.
    OnAnimatorIK act like Update

    but the object navi is not moving at all.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742