How do I pull an object towards the player?

I am relatively new to using UE but I started using it because of it’s blueprint system and the interesting new features in UE5. I’m trying to make my first full game and I’m trying to add a way to hook an object and pull it towards the player (sort of like the lasso from RDR2). I have scoured the internet far and wide and have found basically nothing. My blueprint so far is shown below, any help will be much appreciated!

Just to clarify, I am trying to make a system where the player points at a physics object, presses the middle mouse button and the object is pulled towards the player by a short burst of force (As shown in this realistic diagram)

Add Force expects to be called every frame. If you want to yank it bit-by-bit, Add Impulse instead. If it does not budge, tick Vel Change to test it out (this will ignore mass). If it works, untick it and adjust the force needed.

Another thing is the shape of the collider. If you’re dragging a cube over craggy terrain, it may snag. If you are, indeed, dragging boxes, it may be a good idea to make the collision more forgivable; a bevelled edge like this can work really well:

18 DOP will be fine in most scenarios.

To clarify, if you wanted to pull for as long as you hold the MMB:

If it’s click once - pull a bit => Add Impulse instead.

Thank you so much! I’ve got things moving when you click them, though now they move in a constant direction. If you wouldn’t mind helping a bit more, could you help me make it move towards the player? If not don’t worry, thanks!

Not 100% certain how you need it to work (despite the cool diagram!) but if I wanted to click to pull a bit, I’d:

Image from Gyazo

For key hold & continuous drag:

Image from Gyazo

May need extra work…

Accounting for distance checking:

3 Likes

When it comes to line tracing, depending on how it’s going to work. If you’re using a third person perspective, a lot of the time the camera will point towards the ground providing it’s attached to the player. The player’s default location is where their feet are, so we’re going hit the ground often unless we look above the horizon.

Perhaps it’d be more sensible to trace from the capsule (centre of the player) towards the cursor in order to check for line of sight; as in:

  • i want to drag the red box on the right
  • but my camera is not looking there at all
  • also here the trace would immediately hit the ground if it were to follow camera’s direction from the player’s feet (location)

Hence the suggested get hit under cursor. Admittedly there are many ways to set it all up.

Thank you so much!!
You have no idea how much you’ve helped! I now have the exact result I desired. I wish you the best in everything in the future!