EndLedgeSnap()

public void EndLedgeSnap()
    {
        try
        {
            Leaves leaves = ledgeCol.gameObject.GetComponentInParent();
            Vector3 closestLedge = leaves.GetFacingLedge(transform.position);

            transform.position = new Vector2(closestLedge.x + (.3f * transform.localScale.x), closestLedge.y + 2.5f);
        }
        catch (NullReferenceException)
        {
            // empty for now, will be back
        }
        rb2D.gravityScale = 3;
        ledgeCol = null;
        isVaulting = false;

    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *