Example #1
0
    protected void CheckDistanceToPlayer()
    {
        float distanceToPlayer = (transform.position - player.transform.position).sqrMagnitude;

        if (distanceToPlayer < interactionDist)
        {
            gameSystem.EnableToCallNpc();
        }
        else
        {
            gameSystem.DisableToCallNpc();
        }
    }