Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

how tomake a grappling hook 2d?

who knows how to make a grappling hook in unity 2d ?

Answers

  • RailgunRailgun Member

    Depends on how you have movement set up and what kind of interaction with the environment you want to have while the player is grappling.


    One option is to just Transform.translate towards the target, but this would be completely outside of physics and collisions unless you write some code to handle those things.

    Another is to modify the velocity of a rigidbody2d component in order to send your character straight towards the target. This will allow for collision detection automatically.

    Another slightly more complicated option is to use a tween plugin and tween towards the target. This will face the same issues as translating but will give you more control over how the grapple movement plays out. For example, you could easily make the character start out slower or decelerate at the end. Here's a list of common easing functions to get an idea of what you could do: https://easings.net/en

Sign In or Register to comment.