Volume-casts are unreliable at very shallow angles/proximity

I was making a custom made character controller using shapecasts with capsule models that fit on a roblox character. However I’ve constantly had problems with the character phasing through walls when going at them almost parallel and then walking straight towards the wall.

Upon investigating further I realised the meshpart will almost always clip with objects slightly visually, which eventually ends up in a clip at a certain angle.
I experimented with a ball, block and a few capsule meshparts using all 3 volume casting methods. And if the angle is narrow enough even at some very thick “skin width” (like 0.5 studs), the player can clip through walls. This is quite frustrating with the current casting accuracy. As the player can technically move at any angle and clip through something even at a thick skin width of 1 stud.

Replication
Demonstrating the issue using walls with 0.1 degree and 0.01 degree rotation on the y axis.
Do note that replicating the issue in this showcase is done easiest when the rotations are zero or the skin width value is small (0.1-0.2 studs).
Move one of the “MoveThis” parts on the X axis on the sides of the walls precisely and the issue will occur.

Notes:

  • The capsules were created in blender and imported to Roblox.
  • “Skin width”: Is the number added on the cast distance, to account for the edge touches and floating point inaccuracy. Then subtracted from the hit distance before positioning the part.

I’ve been going insane over this for so long for why this happens, since I’ve followed a method used in a custom Unity controller from scratch, it works as intended as shown. From all the observation, I think the volume casts are too inaccurate for precise use cases unlike raycasts.

System info:
13th Gen Intel(R) Core™ i7-13700K
32.0 GB
NVIDIA GeForce RTX 4060 Ti

Expected behavior

Expected result: Parts should detect surfaces without any physical/visual intersection at any scale, fidelity or angle. And any follow-up casts should not phase through objects at a decently small skin width (at the very least 0.1 studs).

A private message is associated with this bug report

3 Likes