GetTouchingParts() not working properly

Hello.

I know there are many other Topics similar to this so please try not to give me copy and paste answers from all of those. I have found that many people have problems with :GetTouchingParts() but I have tried many of their “Solutions” and none have worked.

My Issue is that I am trying to weld a block in my building game to parts that are surrounding and touching it but it does not work. The Blocks are 2x2x2 stud blocks and I have double checked that the positioning and sizing is as perfect as I can get it. I then copy and paste the block to surround it with a couple other blocks with a ball in the mix as well. When I test the game and it is supposed to say that the surrounding blocks are touching, it does not say that.

Ideas Tried So Far:

  • workspace:GetPartsInPart()
  • part:GetTouchingParts()
  • Various UnAnchoring and Anchoring Combinations
  • Various CanCollide, CanQuery, And CanTouch True And False Combos
  • Welding The Unanchored Parts To Anchored parts instead of anchoring them
  • local Touch = script.Parent.Touched:Connect(function(part)end)
    local Touching = script.Parent:GetTouchingParts()
    Touch:Disconnect()
    print(Touching)
    
  • inserting various waits at various positions (in the case it is firing too early)
  • changing block surface types (which I might have done wrong because idk quite how to use the surface types properly)
  • Changing part size to slightly larger then shrinking back to normal size

The goal I am aiming for is to weld touching parts similarly to how Plane Crazy Welds them. It should not matter if it is done when i am spawning in the creation or when the block is placed, as long as it welds the correct blocks together. Another example is My Previous Game that I tried this in where i got it to somewhat work but the same solution no longer seems to work. (in that game I resized the parts slightly larger, got the touching parts, and then shrank them back to normal size).

You can create a function that checks if a certain Vector3 point is inside of a specific boundry by comparing each vector’s axis to the corner of the boundry.

Then, create a function that takes a boundry of a part you want to see if it’s touching, and a boundry of a part that could touch the part you’re checking for. Loop thru each corner position of the part’s boundry you’re checking for, and run the 1st function that checks if a point is inside of a boundry. If at least one of the cornerns of the part’s boundry you’re checking for is inside, then that means the part’s boundry is touching another part’s boundry.

Use that function on every part that you believe could be touching with the part you’re checking for.

A downside for this method is that you can only check for cuboid shapes. If you run this function on a wedge, it would still check the wedge as if it was a cube.

Ye the main problems with this is that It could be potentially laggy and would be harder when trying to detect the differences between the parts. My game has multiple blocks with odd shapes and this would not work or be harder to implement with those shapes. It is a good backup plan though. or a good temporary solution.