Ejemplo n.º 1
0
    void Pull(float distance)
    {
        float   velocity  = ((((currentPullSize - distance) * (currentPullSize - distance)) / (currentPullSize - currentSize)) * PullStrength);
        Vector2 direction = (transform.position - playerObj.transform.position).normalized;

        playerHandler.AddVelocity((velocity * Time.deltaTime) * direction);
    }