Hey there!
I wanted to bring up a request for an improvement in the collision detection capabilities and obtaining contact points during collisions. Example use cases within the movement system I aim to replicate:
- Movement on slopes
- Resetting state based on contact surfaces. I want to reset the state when in contact with the floor but avoid resetting when in contact with walls. Instead of manually marking each surface, I intend to determine walls and floors based on the angle of contact.
- Sticking to the ground in custom gravity system
In Unity, I have utilized the Collision.GetContact
function, which provides valuable information about contact points during collisions. This allows for precise control and customization of movement systems. Here is the documentation for reference: Unity Collision.GetContact and Unity ContactPoint.
In contrast, Roblox offers the GetTouchingParts
function, which returns the object with which contact occurs but lacks detailed information about the contact points. The documentation for GetTouchingParts
can be found here.
Alsoo, in Studio Settings → Physics we have “Are contact Points Shown”. This information displays where objects are colliding. If it’s done using the physics engine features and not just raycasting, then it’s already implemented. However, having an API for this would be great.
Here is demonstration of contact points (red points) enabled in StudioSettings:
And in this demonstration you can see direction of collisions (red arrow)
My request is:
- Enhance
GetTouchingParts
: It would be awesome to have a function similar to Unity’sCollision.GetContact
that provides accurate contact points during collisions. This would give us more flexibility in creating custom movement systems. - Expose Collision Debugging Information: Roblox Studio provides a debugging tool that displays contact points and normal vectors during collisions. It would be really helpful if developers could access this information programmatically from their scripts.