2D GRAPPLE GUN QUEST: ‘Yoink’ - Solutions

Quest: 2D Grapple Gun Quest
Challenge: Yoink

Feel free to share your solutions, ideas and creations below. If you get stuck, you can find some ideas here for completing this challenge.

Here’s my solution:

private void PullPlayer()
    {
        //Challenge 2:  
            joint.distance -= Time.deltaTime * grappleSpeed;
    }
2 Likes

I made some few more steps and move the “PullPlayer” method calling to the if statement that checks if the player is holding down the mouse button

private void PullPlayer()
    {
        joint.distance = Vector2.Distance(playerHand.transform.position, hit.point);
        Vector3 dir = (Vector3)hit.point - this.transform.position;
        dir.Normalize();
        transform.position += dir * joint.distance * grappleSpeed * Time.deltaTime;
    }