Getting a list of parts touching a main part while the main part has no collisions

I want a list of parts touching my main part
the parts that will be touching and need to be detected will have collisions on.
The main part does not have collisions on.

This script is put inside the parts I want to detect touching parts in

local Sea = script.Parent
local Workspace = game:GetService("Workspace")

local Touching = {}

local Overlaps = OverlapParams.new()

print("run")
while true do
	task.wait()
	TouchingNow = Workspace:GetPartBoundsInBox(Sea.CFrame, Sea.Size, Overlaps)
	
	-- Cleans up past Floaties
	for _,Toucher in pairs(Touching) do
		if not table.find(Toucher, TouchingNow) then
			Toucher.Floatie:Destroy()
			print("Cleaned")
		end
	end
	
	-- Creates new floaties
	for _,Toucher in pairs(TouchingNow) do
		if not Toucher:IsDescendantOf(Workspace.Boats) then
			return
		end
		if not table.find(Toucher, Touching) then
			local Floatie = script.Floatie:Clone()
			Floatie.Parent = Toucher
			Floatie.Attachment0 = Toucher:FindFirstChild("FloatPoint") or Toucher:FindFirstChildOfClass("Attachment")
			print("FloatingWork")
			local YDistance = (Toucher.Position - Vector3.new(Toucher.Position.X, Sea.Position.Y + (Sea.Size.Y / 2), Toucher.Position.Z)).Magnitude
			Floatie.Force = Vector3.new(0, YDistance * 2, 0)
		end
	end
	
	-- Updates Floaties
	for _,Toucher in pairs(TouchingNow) do
		print("Working")
		if not Toucher:IsDescendantOf(Workspace.Boats) then
			return
		end
		print("Floatwork")
		
		local Floatie = Toucher.Floatie
		local YDistance = (Toucher.Position - Vector3.new(Toucher.Position.X, Sea.Position.Y + (Sea.Size.Y / 2), Toucher.Position.Z)).Magnitude
		
		Floatie.Force = Vector3.new(0, YDistance * 2, 0)
	end
	
	Touching = TouchingNow
end

To detect collision, you could use :GetPartsInPart

if you want just touching the part then you have to use GetTouchingParts() this returns part that are touching not inside the part

if you want all the parts that are colliding with the part then use GetPartsInPart()

if these dont return anything you could always set the main part to be collidable and touchable then run the function, then instantly turn it off. during that time nothing will collide with it

now this doesnt have anything to do with what you want but i see you are trying to make some sort of way to make stuff float on the water. the issue with this is detecting collisions between parts is very slow and unreliable for this kind of thing. you should use a Y check for this instead. this will be much more reliable

for example:

if y <= 0 then
    float
end

also using a while true with task.wait is bad for something to do with physics. you should always use RunServicr.Heartbeat. this runs every physics tick and will be synced with everything else

just my suggestions to improve what you are trying to do

I tried using GetPartsInPart and it didn’t return any parts that were inside it

You can use this GetTouchingParts method which behaves similarly to the normal one but it works with parts that don’t have collision on as well

local function GetTouchingParts(part)
	local connection = part.Touched:Connect(function() end)
	local results = part:GetTouchingParts()
	connection:Disconnect()
	return results
end

TouchingNow = GetTouchingParts(Sea) -- returns parts touching "Sea"

do this and it should return parts

Theres… multiple Y levels

I need some way to prevent boats from going up and down on the water wildly or falling straight through it
the water moves also.

I thought perhaps this would work but its quite expensive or at least how I am doing it right now
any suggestions

if the water moves you can use a function to calculate the y value at a point (vector2, x z)

also since you have moving water, using Touched is really bad. it wont be accurate at all nor update fast enough

you could always simulate boat buoyancy to stop that bouncing of the boat

but yes you are right, moving the water is very expensive on the game especially if you arent using a skinned mesh (which looks like you arent)