Ejemplo n.º 1
0
    private void CalculateTime()
    {
        randomizedSpeed = speed + Random.Range(0.5f, 1.5f);

        target             = PenguinArea.RandomPosition(transform.parent.position, 100f, 260f, 2f, 13f);
        transform.rotation = Quaternion.LookRotation(target - transform.position, Vector3.up);

        var timeToGet = Vector3.Distance(transform.position, target) / randomizedSpeed;

        nextActionTime = Time.fixedTime + timeToGet;
    }