What is a reliable way to detect touch?

I’m trying to find a reliable way to detect touching parts because all the Roblox-given methods that I tried don’t work. Touch events don’t work because both parts involved are anchored, and getting the parts inside the parts doesn’t work because the parts aren’t inside each other. The only thing I could think of doing was duplicating the part, making the duplicate slightly bigger, and getting the parts in the duplicate. I was wondering if one of you guys would be able to come up with a better solution. Thank you in advance.

maybe check if Part1’s position resides within Part2’s area or surface and that way you can check their collision.

1 Like

The problem with using position is that a parts position resides within the center of the part. This means that the center of the part would have to be on the surface/within the area of the other part. This could maybe work if the part was really small, but it definitely wouldn’t work with large parts. Appreciate the suggestion tho :slightly_smiling_face:.

I did some of my own research and checked out this post that had a similar issue:

The solution involved using “GetPartsInPart”, not sure if you’ve tried this method yet.
Here’s the documentation for it: WorldRoot | Documentation - Roblox Creator Hub

I’ve already tried this method and it didn’t seem to work for me, and to be honest, I don’t really know why :person_shrugging:.

Maybe you can try Shapecasts (A Blockcast should most likely work)

That could work, but the issue with that is that what if the part is a union, and its in the shape of an S for example? A Shapecast wouldn’t be able to have the same shape as the part, making the hitbox inaccurate.

there was an equasion i used to get the whole surface of the part and figure out where on the surface a certain position is.