Someone on the Scripters forum was asking how he can find the point of contact in the BasePart’s Touched event, and after looking into it, I’ve ultimately come to the conclusion that it would be ridiculously over-complicated to try and figure this out manually with Lua.
Could you guys please expose the points of contact as an array of Vector3s as the 2nd argument of the Touched event?
I know the engine is fully aware of the Vector3 contact points, because you can toggle a debug option that shows them.
“I know the engine is fully aware of the Vector3 contact points, because you can toggle a debug option that shows them.”
You know that the engine can be aware of contact points, not that it is aware of them all the time. Calculating precise contact points can be a tricky challenge depending on which collision method they’re using, and in most cases, involves running a second function on top of a simple collision test just to get the points of.
If they do add the ability to see this, the availability of the information may not be consistent if they switch to another engine, I’d opt for a secondary function instead of overriding the .Touched event
What was his question exactly? Depending on what he needs, there may not be a requirement to get collision points precisely, for instance, if containment of the objects is not possible, then he can just check for points that have a zero or negative dot product to the surface normal, and clip the points by the size of the part’s face they are touching. If he doesn’t need to clip to the face at all, or just find one corner of the brick that’s the most likely collision point, things get trivial.
Edit: Oh, that reminds me, I have a 80% written 3D SAT algorithm I was making for a project on Roblox, but the project ended up not needing it, if you know anything about math you could finish it up to get collision points, or use it as a base for a solution to represent to him