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.
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.
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.
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.
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.
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
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!
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?
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: