Example #1
0
    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);
        }
    }
Example #2
0
    void Start()
    {
        ai                 = GetComponent <ZombieAI>();
        walker             = GetComponent <ZombieWalker>();
        mainCollider       = GetComponent <CapsuleCollider>();
        rb                 = GetComponent <Rigidbody>();
        deflectorLayerMask = 256;

        currentDestination = ai.GetNextWaypoint(currentDestination, arrivalDistance, isOnPath);
    }