Easy 2D Grappling Hook

What it does

Quickly and easily add a tight and responsive grappling mechanic to your 2D game. Often grappling hook mechanics are added by using Joints or adding forces to your player in the direction of the rope, this results in the swinging feeling sluggish and inaccurate. EasyGrapplingHook fixes this problem and results in a smooth and responsive gameplay experience.

How to use

To attach the rope to a point, call the function

AttachRope(Vector2 grapplePoint)

This will start the player swinging around the point.

 

Once attached

 

To control reeling in and paying out, call:
SetReelingIn(bool currentReelingState)
SetPayingOut(bool currentPayingState)

 

To release the rope, call
ReleaseRope()

screenshot2

Examples and Demos

Demo scene included with package

Simple implementation example with mouse input (input manager included in package)

Example Game

Online game using grappling as main mechanic. Made with Easy 2D Grappling Hook. (Unity Web Player)

Requirements

  • Player needs to be on its own layer; this is to ensure the grappling hook does not attach to the player.
  • The player objects needs a LineRenderer and Rigidbody2D attached.
  • The objects the grappling hook can wrap around and collide with need to be marked static and have any variant of the Collider2D attached

Overview

  • Easily and quickly add grappling mechanics to your 2D game
  • Rope collisions and wrapping effect with any Collider2D
  • Included input manager for mouse input
  • Fast and responsive swinging