/Grappling-Hook-Example

How to grapple hook (in Godot)

Primary LanguageGDScriptGNU General Public License v3.0GPL-3.0

Grappling-Hook-Example

How to grapple hook (in Godot 3.3) using Hooke's law. If you make something with this, it'd be nice to let me know or credit me! (Calvin Wong)

alt text

The equation: Fs = ks * (distance(pa, pb) - L)

This gives the force Fs as a scalar (a single number), not a vector, where distance(pa, pb) is the distance between the two ends of the rope/spring, L is the rest length of the rope/spring, and ks is just a customizable constant for how stiff the rope/spring is.

I also included some nice lighting, and messed with the default toon shader.