#How to Ledge Grab?

3 messages · Page 1 of 1 (latest)

quartz aurora
#

The concept is pretty simple
You have 3 raycast.
Ray1 is at top of head going forward
Ray2 is at chest going forward
Ray3 is as high as Ray1, but a bit forward i front of body a few pixels, going down

They work like this

If Ray1 doesn't collide but Ray2 collides with something, then you are close to a ledge and should enter hanging state

Then you calculate the distance with Ray3 and correct your hanging position

light dock
quartz aurora
#

What I write above is how people usually do ledge grab both in 2d and 3d. I've tried it in 3d and it works