# 2D Grappling hook Blueprint \[HELP\]

**URL:** <https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [September 25, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219 "2024-09-25T19:02:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 25, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/1 "2024-09-25T19:02:09Z")

</div>

Hello, I am a beginner in Unreal Engine and I want to create a grappling hook that pulls the player for my first 2D game. I have watched several videos on YouTube, but unfortunately, they are all directed towards 3D. Therefore, I tried to create something using ChatGPT, but unfortunately, it does not pull the character. I would appreciate your help in guiding me in the right direction.

[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/5/e25260a2312800771bfb5988156ba733cf635e98.png "2D Grappling hook Blueprint [HELP]") ](https://imgur.com/a/2d-grappling-hook-blueprint-help-izAGIWF)

Thank you for your attention.

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [September 25, 2024, 7:17pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/2 "2024-09-25T19:17:49Z")

</div>

Hey @Mw1ng0l3! Welcome to the forums!

Real quick- can you explain which parts are not meant to be part of the code? Things like this are confusing when asking this question- if there CAN be a white line and there isn’t one going in, generally it will not do anything at all.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/6/776a473b1d6a47a5753e1e297c42dcc1b8665d59.png)

One think I will point out- anywhere you see a yellow (vector) pin, you can right click to “break struct pin” and get your X, Y, and Z separated. So what you’ll do with that is you’ll make sure your X or your Y, whichever is your unused one, is set to what it needs to be, and let the other two be what determines your new point. So you’ll use “Make Vector” and plug in your new X Y and Z. 🙂

Hope that helps! Get back to us!

---

<div class="post-metadata">

**Author:** ![tyconner](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tyconner/32/1203517_2.png) [@tyconner](https://forums.unrealengine.com/u/tyconner)\
**Post date:** [September 25, 2024, 7:19pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/3 "2024-09-25T19:19:32Z")

</div>

Your set nodes on the upper part are not connected into any execution. They will not run. Your grappling custom event has the attach point as 0, 0, 0 which will always be the origin of the world. I’d recommend you have a different test location than this since it’s a grappling hook. Maybe something higher in the air. Also in your grappling custom event you should set the input “Attach Point” location vector as a variable like ‘TargetAttachPoint’ or something similar.

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 25, 2024, 7:25pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/4 "2024-09-25T19:25:37Z")

</div>

Thank you for your quick response! I’m not entirely sure which parts of the code should remain as is. I’ve been following tutorials and consulting GPT chat to adapt what was shown in the video to a 2D setting, which led to the current scenario shown in the screenshot. I apologize for the confusion.

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 25, 2024, 8:36pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/5 "2024-09-25T20:36:56Z")

</div>

[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/0/a208b2926406aedb4eccbf2f09b056dafa2d84cd.png "imgur.com") ](https://imgur.com/t5snAKI)  
[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/f/b8fcb555e981a2b5ecf449d250021cb048acef1a.png "imgur.com") ](https://imgur.com/q26QZrR)

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [September 26, 2024, 12:12am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/6 "2024-09-26T00:12:07Z")

</div>

This looks like it should work with minor alterations, as long as your timeline is set up correctly!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/4/b64a34a1ee90a5f5037e1e2799f9a17d0bec5f3f.jpeg)t  
Hope this helps!

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 26, 2024, 4:52am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/7 "2024-09-26T04:52:16Z")

</div>

I’m sorry, It didn’t work the result is the same, I does not push himself

[[Album] imgur.com ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/9/1597859f91144c1cc36f9f61b60cc3bff426efc4.png "imgur.com") ](https://imgur.com/a/s32psAj)

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [September 26, 2024, 12:07pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/8 "2024-09-26T12:07:01Z")

</div>

Well, darn!

Can you show your code with my updates to it so I can see if there are any errors?  
Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 26, 2024, 7:09pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/9 "2024-09-26T19:09:57Z")

</div>

Yes here it is [Update 1 - Album on Imgur](https://imgur.com/a/3Ggm3t1)

investigated and tried to adapt the Blueprint a bit more, and I ended up with the Blueprint like this. This time, it manages to pull me for some reason, and the lines turn green. I think it’s not working because it doesn’t detect the ground and walls, which is why it’s red? [I changed the code - Album on Imgur](https://imgur.com/a/K2EvoEH)

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [September 26, 2024, 8:54pm UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/10 "2024-09-26T20:54:38Z")

</div>

I think the reason for this is as I stated above- you need to have your X (or your Y whichever is the one that’s locked) for your mouse traces be set to whatever your character is locked to. Only the Y and Z (or X and Z) need to be changeable- what’s happening is it’s getting the traces either too close or too far away from the camera! 🙂

Pic: They’re all coming toward the camera.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/c/20c595598077903d6d91be5265726eef4d6b566b.jpeg)

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 27, 2024, 4:57am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/11 "2024-09-27T04:57:07Z")

</div>

How can I fix it?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 27, 2024, 8:05am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/12 "2024-09-27T08:05:47Z")

</div>

I did not read the entire thread, but what are you trying to do again?

- trace from the character towards the cursor?
- trace from the camera towards the cursor?

One way or another, check this thread out:

> [@Line Trace from a 3d point to mouse location](https://forums.unrealengine.com/t/line-trace-from-a-3d-point-to-mouse-location/237661/3):
>
> You’re tracing with a fixed distance of 500, replacing the projection’s X with a fixed value. It’s actually hard to imagine how that would look like, a strangely distorted / twisted undulating surface mayhaps? cool, for sure. I want this trace to stay on the same plane as my character, so the X value of the start point & end point should be the same. Consider the following: green_circle create a virtual plane where the character is and point it towards X (Plane Normal 1,0,0) …

This will work for 3d and 2d but you may need to increase the trace distance if the camera is far away from the character.

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [September 30, 2024, 5:25am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/13 "2024-09-30T05:25:40Z")

</div>

Hi, Thank you for the reply, I’ve seen your link and I tried to implement based on your comment, but I’m having a hard time can please tell me how can I adapt to my blueprint?

[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/c/84cd5346507a2e454f6a6c1070f206acc679c020.png "I changed the code") ](https://imgur.com/a/i-changed-code-K2EvoEH)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 30, 2024, 5:35am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/14 "2024-09-30T05:35:14Z")

</div>

Try using the nodes as shown in the thread.

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [October 2, 2024, 5:57am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/15 "2024-10-02T05:57:49Z")

</div>

I tried, but it did not work. I also tried stripping down what was happening in the blueprint and came to the conclusion that a few things were not doing much of anything, and I ended up with this:

[[Album] Blueprint ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/1/3a1fa9882f0083fbfa6ea56e9f8ce16072152f84.png "Blueprint") ](https://imgur.com/a/5NcTJ7w)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 2, 2024, 7:07am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/16 "2024-10-02T07:07:51Z")

</div>

> [@Mw1ng0l3](#):
>
> I tried, but it did not work.

Could you show the full implementation, as in the thread with line intersection? We can’t see how it was set up and it’s easy to make a mistake.

---

<div class="post-metadata">

**Author:** ![Mw1ng0l3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mw1ng0l3](https://forums.unrealengine.com/u/Mw1ng0l3)\
**Post date:** [October 3, 2024, 5:26am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/17 "2024-10-03T05:26:40Z")

</div>

Of course, here: [Imgur: The magic of the Internet](https://imgur.com/a/VjTG7iG)

Thank you so much for helping me

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 3, 2024, 5:33am UTC](https://forums.unrealengine.com/t/2d-grappling-hook-blueprint-help/2038219/18 "2024-10-03T05:33:23Z")

</div>

The script looks OK.

• how are you calling it?  
• are we sure Plane Origin 1,0,0 is correct?  
• is 10k trace long enough?  
• what result are you getting?

Asking as we have no clue how the scene is set up.
