private void ProcessPathMovement() { isOnPath = true; walker.SetDestination(currentDestination.transform.position, 1); if (Vector3.Distance(transform.position, currentDestination.transform.position) <= arrivalDistance) { currentDestination = ai.GetNextWaypoint(currentDestination, arrivalDistance, isOnPath); } }
void Start() { ai = GetComponent <ZombieAI>(); walker = GetComponent <ZombieWalker>(); mainCollider = GetComponent <CapsuleCollider>(); rb = GetComponent <Rigidbody>(); deflectorLayerMask = 256; currentDestination = ai.GetNextWaypoint(currentDestination, arrivalDistance, isOnPath); }