Hi all,
Just ran into a brick wall on something i’ve been working on, as I’ve just discovered that a Collider2D does not have the same “ClosestPointOnBounds()” method that a standard Collider has.
I was hoping to use this method in order for my grappling hook script to work out where to plot “points” where the rope bends around various objects in the level. My logic for the rope was this:
- Raycast from the player to the last rope point.
- Use Collider.ClosestPointOnBounds() to snap to the nearest corner and store if position is different to last stored point.
Without the ability to snap the collider’s nearest point, I can’t see how I can make the rope appear to bend around objects. I was going to use these stored points to update a line renderer.
does anyone have any other ideas?
Thanks
Mat