Checking if a solid part is within a non-cancollide part WITHOUT USING TOUCH EVENTS

No touch events okay? They are far too unreliable for what I need this for.

There has to be some way to check if a solid part is within another part that is non-cancollide.

At this point I could care less about performance. I have hit this wall far too many times and I am getting sick of it.

Is there any possible way? And I mean ANY!

1 Like

If it’s a regular part (not a ball, union, mesh, wedge, or cylindar), you can use Region3.

Create a region at the part’s position and the same size as the part, and check for parts within that region.

1 Like

Why do you not want to use touched events?

One way you could do it is with GetTouchingParts ( )

Make a clone of the non-collidable part, set it to canCollide, and put it in workspace. Get it’s touching parts, then destroy it. If your solid part is in the list, then it’s a hit.

There are other solutions aswell, but you should supply more details and some relative context if you want to find the best solution.

3 Likes

Touch events do not respond well, atleast the TouchEnded event.

You may be interested in my GJK distance and intersection module. It allows for easy intersection tests between any convex shapes, including those without points (spheres, circles) in up to three dimensions. In a recent test and with some recent optimizations, detecting a sphere resting on a baseplate runs in about half the time a call to print takes, and when the ball is not touching it can detect the separation very, very quickly (for a Lua program, that is).

Here are some of the topics I’ve mentioned it in. Some include examples usage while others describe the process.

1 Like

I’ve seen you post multiple threads over the past week regarding raycasts, touched events, etc. This seems like XY problem behavior. You should try posting a thread with the fundamental problem that you are wanting to solve, not about the solutions that you think will solve the problem.

2 Likes