ControllerPartSensor cannot find floor if caught on ledge

An issue that can arise is if your RootPart has Collision and a ControllerPartSensor, you leave yourself open to an edgecase where if the Rootpart gets caught on a ledge it cannot figure out that it’s still on the ground. This causes a myriad of issues such as being in the wrong spot vertically and being unable to have the controllermanager move the rig anymore.

If I had to guess it’s surely because the ledge part is so close to the sensor part that the sweep cast will just ignore it.

The best workaround is usually to have 2 Parts, one doing collision and one for the sensor. That way you can avoid the ledge issue.

However, it would be ideal if this edgecase didn’t occur out of the box.

1 Like

Thanks for the report! Do you have a minimal reproducing rbxl file you could share with us? That would make debugging mush easier. Thanks!

1 Like

Been having a rough time getting a solid repro. Starting in a stuck position by copying and pasting the contents and running doesn’t repro properly for some reason.

Here’s the place file if you’re interested, I’ll have to look into it more on how to get a better repro.

wacky.rbxl (60.1 KB)

Honestly I’m not even sure what I’m expecting anymore from CharacterController

It’s because when the raycasts in front and behind the part don’t hit anything, we do four raycasts at the part corners - but the raycasts are slightly inset into the part by about ~10% of the part’s size, so you don’t get hits at the part edges.

This is actually intentional and designed for backwards compatibility with the old Humanoid controller, because e.g. competitive obbys depend on that exact behavior.

You can work around it by putting the ControllerPartSensor in Manual mode and shapecasting yourself. We could also fix it by adding a new more exact sensor mode that diverges from the legacy Humanoid behavior (in which case I’d consider this a feature request).

2 Likes

Alright, I guess I’ll write a feature request for exactness at some point

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.