How to detect collision of an anchored part, moved by mouse?

I have 2 parts: Part1 and Part2.
Both are ANCHORED.
I want to move Part1 with the mouse and detect the collision with Part2.
For that, I change and change Part1.CFrame, inside UserInputService.InputChanged, based on the mouse RayCast.

I realized that Touched will not be activated by CFrame if BOTH parts are anchored.

But if I leave Anchored=false for some part, it will be affected by physics, moving when there is a collision.

I just want to detect if one part collided with the other, using CFrame.
How to do this?

You can use :GetTouchingParts() it returns a table of all of the parts that are currently touching the part you called the method on. Just :GetTouchingParts() every time you change the parts CFrame and then check if what is returned is not a nil table.

2 Likes