How to remove borders from ledges

I would like to reduce or remove the borders from cliff edges but I want to keep the borders where the walls would obstruct the character’s collider.

How can I achieve this?

So if I’m understanding, it looks like you might be trying to have the character be able to walk “up to” the edge, directly up to it, but you still want to keep them from running into other colliders. That sound right?

Yup, that’s correct. I would like characters to be able to partly overhang ledges. I understand that the center of the character is used as a point of reference for where the character will be bounded inside the walkable area, and not the outer perimeter of their radius. Walls, however, should still stop a character from walking any closer than their radius allows.

This is unfortunately not easily done.
The recast graph sees both cases as pretty much identical internally.

What you can do is to add an invisible collider that extends outside the ledge.

1 Like

Thanks for taking the time to get back to me. I’ll figure something out.

  1. I made a ledge detector by first performing recastGraph scan with a much narrower collider radius. This is the “ledge graph”
  2. Then I ran my edge detector on the ledge graph, which will include edges that are adjacent to walls that have to be filtered out.
  3. Then I did capsule checks on the endpoints of all my ledges.
  • If the capsule checks hit something on both endpoints, I discard the ledge.
  • If the capsule checks hit neither endpoint, I keep the ledge.
  • If the capsule checks hit only one endpoint, I perform a capsule cast from the other opposite endpoint to the struck endpoint and then shorten the ledge appropriately.

Tomorrow I will investigate:

  • making my stored edges match the detected ledges
  • extending the graph triangles to match the ledge geometry.

tomorrow is today, time to make the edges match up with the ledges.


Most of those edge normals almost perfectly match up with the ledge normals.

The corners are, as expected, a corner-case, and I dunno what to do with them.

So let’s pick the low-hanging fruit and maybe I’ll figure out what to do with the corners.

So most of the edges look great, corners are still messed up…

image

…and the small post is especially messed up…

Okay. I should maybe take all the unmodified corners and add them to a list and then process them separately.

image

Also, I can see that some of the corners got torn apart in the process, so I should make something that keeps those corners together.


Projecting along the edges caught some more of the corners…