:GetPartsInPart() Doesn't Work!

Hello people and developers! :wave:
(There are probably a lot of solutions, but I actually read and couldn’t find anything wrong with my code)
I have a custom hitbox, and when using :GetPartsInPart(), it does not work at all. Nothing gets returned. Here is the sniplet which you need most likely:

ExecutionRemote:FireClient(Player)
		local OP = OverlapParams.new()
		OP.FilterType = Enum.RaycastFilterType.Exclude
		OP.FilterDescendantsInstances = {Character}
		local Hits = workspace:GetPartsInPart(LaunchHitBox, OP)
		
		local Potential = {}
		print(Hits, "Hits")
		for i, v in pairs(Hits) do
			local PCharacter = v.Parent
			if PCharacter:IsA("Model") then
				local PHumanoid = PCharacter:FindFirstChild("Humanoid")
				if PHumanoid and PHumanoid:IsA("Humanoid") then
					print(PCharacter)
					if Potential[PCharacter] == nil then
						Potential[PCharacter] = PCharacter
					end
				end
			end
		end

This is how it gets called:

--Mover and Launch
	local MoveThread = coroutine.create(function()
		task.wait(RS_Settings.Server.LaunchDuration)
		StopLaunch()
		coroutine.yield()
	end)
	coroutine.resume(MoveThread)

	--Touched and Stop Thread
	local TConnection = nil
	TConnection = LaunchHitBox.Touched:Connect(function(Part)
		local PCharacter = Part.Parent
		if PCharacter:IsA("Model") then
			local PHumanoid = PCharacter:FindFirstChild("Humanoid")
			if PHumanoid and PHumanoid:IsA("Humanoid") then
				TConnection:Disconnect()		
				coroutine.close(MoveThread)
				StopLaunch()
			end
		end
	end)

Now here are the print statements:
image
Clearly its not returning anything. If I remove the OverlapParams, it returns my own character :skull:
Here is ingame picture btw: ITS CLEARLY HITTING
image
Thanks for stopping by! :slight_smile:

1 Like

Does :GetPartBoundsInBox() work?

1 Like

Let me go check real quick of this instead!
Ill reply back if it works

1 Like

If it doesn’t work, you could probably also use [hitbox]:GetTouchingParts()

1 Like

Ok so that also doesn’t work :frowning: I’ma try the other one (TouchingParts)
Here is the same thing btw
image
Will reply back with the other results

Yep and that one also doesn’t work :frowning:
image
Could this possibly be a bug I should report or I’m just stupid to miss something

Does the part have CanTouch set to true?

1 Like

you probably turned off canquery

1 Like

Don’t be quick to assume it is a bug.

Think about these questions:

  1. Have you got CanQuery or CanTouch off? (thanks @sonde_v @Sniperkaos)
  2. Are you sure this service isn’t deprecated?

Search on the docs if you need more help, the devforum isn’t the strongest source of information of all kinds,

1 Like

debug test script… may help you figure it out.

local OP = OverlapParams.new()
OP.FilterType = Enum.RaycastFilterType.Exclude
OP.FilterDescendantsInstances = {Character}

local Hits = workspace:GetPartsInPart(LaunchHitBox, OP)

if #Hits == 0 then
    print("No parts detected. Check HitBox position, size, and exclusions.")
else
    local Potential = {}
    for _, v in pairs(Hits) do
        local PCharacter = v.Parent
        if PCharacter:IsA("Model") then
            local PHumanoid = PCharacter:FindFirstChild("Humanoid")
            if PHumanoid then
                Potential[PCharacter] = PCharacter
                print("Detected:", PCharacter)
            end
        end
    end
end
1 Like

Ok so here are the properties:
image
image
Massless is there because of air drag and I don’t want a slowness effect cuz of downweight.

I have searched everywhere, even on the documentation. I cannot find anything. I even asked AI :skull: which was already a stupid mistake. AI makes up libraries and gives the wrong advice.

1 Like

Try turning on CanCollide and see if that changes anything.

1 Like

Nope, I already tried that and here are prints:
image

Maybe try CollisionGroups? It may be what you are looking for

1 Like

Wait guys I think I found something:
I change the transparency to like 0.65 and look what is does now :sob: :sob::
image
Nothing else was changed and I don’t get what transparency has to do with collisions and spatial queries.
image

Here is the changed:
image

Is this fixed now… or what?

Let me identify if its a bug if I put the transparency back to 0 and then if yes Ill mark something as a solution. Will reply asap

1 Like

Ok so I switched the transparency back to 0 and now it works. I will mark myself as a solution to make it fair but if any of you guys might have an idea on why this keeps happening, do stop by and reply!
Hope you guys have a great day :slight_smile:

image

EDIT: It doesn’t work at all again :frowning: It keeps doing wierd things each time in each session

1 Like