r/howdidtheycodeit • • 1h ago

Question How did they make such a versatile physics based grapple hook in Unreal?

Played this old Attack on Titan fan game years ago, in UE4, and have wondered ever since how they managed to make this so smooth. Despite all my trying and making similar mechanics I've never been able to figure out how this works so flawlessly.

0 Upvotes

2 comments sorted by

1

u/Dragon20C 1h ago

I think there could be multiple of ways of recreating this type of movement and one that comes to mind is using a rigidbody, since rigidbody works with forces you can pretty much stack momentum, the havent worked with rigidbodies before so I cant really say if this is correct or not, my engine (godot) people prefer using kinematic player controllers so the physics would be needed to be recreated and in my opinion gives you more control since you can override the velocity of the controller.

1

u/chozabu 20m ago

It looks something like:
-store distance for the grapple
-if the player gets closer to the grapple point, shrink distance
-if the player gets further from the grapple point, move them back within distance
-controls for shrinking distance faster, or extending it
-give players extra air control while on a grapple (all 6 directions)

Do you have a link to the game in question? may be able to give a better answer after messing around with it