// Use this for initialization void Start() { mayoibi = transform.root.gameObject.GetComponent <Mayoibi>(); agent = mayoibi.GetComponent <NavMeshAgent>(); }