Grappling Hook Aim Assist

Currently, I’ve implemented a grappling hook in my game: https://twitter.com/qdeanc/status/751310743367086080

The problem is that aiming it is pretty difficult.

I need the grappling hook aim to snap to the closest grapplable object; sort of like this: UE4 Adventu

Can anyone help?

Aim assist is such a common tool in games. Doesn’t anybody know how to accomplish it in UE4?

My best idea would be to use tracing: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/

And so, you’d make a raycast that hits an invisible sphere that you would put around your grapple-able objects, which would return to your actor the instance of object it hit. From there, you do “Get Transform”, then Break Transform and use that object’s Location as a target for your grappling hook.

To specifically track long edges, something can probably be done with splines but I’m no expert.

As a side note, that grappling hook behavior - doesn’t it look a lot like the system used in the Arkham games?

Hmmm… that’s a good start, but I need something that works in relation to a crosshair. I need the grapple to target grapplable objects closest to where my character is aiming in screen space.

I suppose that I could make each grapplable object within a radius of my character shoot a ray at her. If they hit her, then I could store the angle between her aim vector and the vector from each grapplable object in an array and retrieve the object that generates the smallest angle. That would mean that she would always grapple objects closest to where she is aiming, right?

I think the problem with this system is that the rays will always shoot from the center of each grapplable object. I’ll have to place several grapple points on the surface of each grapplable object so that my character can grapple the edges of objects. I wish there was a way to generate grapple points from vertices.

Alright, another idea.

On top of the cast idea I sent, have the object return the coordinates of a spline that’s part of the object, and have a crosshair render over it. I’m not sure how possible it is, but it would be another step forward.

Here’s my aim assist in action. It works just like how I said it would. Now for the crosshair…

Reddit - Dive into anything :slight_smile:
Also: good talk: http://www.gdcvault.com/play/1017942/Techniques-for-Building-Aim-Assist

IF you got issues with sorting arrays, you could use some function library like:

That’s some quite intresting and good looking movement flow you got there. Mind sharing what technique you used to get the grapple going?

The grappling system is just an add force node. When my character reaches a certain distance away from the grappling point, it adds a force towards the grappling point. This force is multiplied by how far my character has extended past the desired “rope” distance so that the force functions like a spring or bungee cable. It’s also multiplied by the angle between her velocity vector and the vector aiming at the grappling point. This keeps my character from bouncing too much by only pulling her towards the grappling point when she’s moving away from the grappling point.

It basically acts as an equal and opposite force that keeps her from moving too far away from the grappling point.

Thanks for the links!

Telling from your tweet, it looks pretty smooth. I wasn’t able to reproduce such good feel with my physics constraint way on my Ratchet and Clank series
(https://www.youtube.com/watch?v=XbIsV-Mt9II)

The grapple you made looks pretty great from what I’m seeing. Perhaps mine simply looks smoother due to my custom character/animations along with how she rotates to always point towards the grappling point.