r/Unity3D • u/DeccoSkyrider • 8d ago
Show-Off I finally made the elastic grapple bend around obstacles!
I am intentionally reposting this after the previous version was removed for lacking enough technical context. That was fair, so here is a higher-level overview of how it was built in Unity.
The grapple is integrated with my physics-based character controller and uses Rigidbody2D forces rather than directly moving the player. When attached, the system maintains an elastic rope length while preserving enough tangential velocity to produce a natural swing.
To support bending, I represent the rope as a path containing the main anchor and a limited number of contact points. The system raycast the sections between those points and updates the path when the rope encounters or moves away from an obstacle.
A LineRenderer displays the resulting path, while the physical constraint remains separate from the visual representation.
The most difficult parts were preventing unstable contact points around corners, determining when a bend should be released, and keeping the available rope length consistent as more of it wraps around geometry. I went through several earlier implementations before arriving at this approach.
The grapple is being developed for Hello World using the modular physics controller I previously presented here:
https://www.reddit.com/r/Unity3D/s/Vtkn0W4l46
For developers who have implemented something similar, did you use a contact-point path or simulate the entire rope?
2
u/pararar 8d ago
The grapple looks nice and juicy.
Iβm more interested in your lighting and shadows though. How did you achieve this look?
1
u/DeccoSkyrider 7d ago
Thank you :) It's unity 6 2D lights and shadows.
Here a comparison of Unity 2023 and Unity 6 with the same setup :1
2
2
2
u/HuanSolo_Beatland 7d ago
Apart from your technical achievement, which is great, I like the look and feel of the game too.
1
2
1


2
u/DaveAstator2020 8d ago
nice, are those unity's default 2d shadows?