Ejemplo n.º 1
0
    IEnumerator TrackObject()
    {
        while (targetObject != null)
        {
            if (Vector3.Distance(targetTransform.position, targetObject.transform.position) < .25f)
            {
                ObjectAttached();
            }
            else
            {
                Vector3 dir = targetTransform.position - targetObject.transform.position;
                targetObject.MoveTowardsHook(dir.normalized);
            }


            yield return(new WaitForFixedUpdate());
        }
    }