Weird collisiongroup bug

Hello! I have attempted to create a kicking system using collision groups. However, the hitbox wont detect the ball even though they can collide in the collision group editor. Heres a screenshot of my collision editor:
{BE65EB66-E36C-4940-B17A-D2BF47AC2C2C}

and here’s a video:
robloxapp-20241005-1323283.wmv (1.2 MB)

and here’s my code:

local plr = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")



uis.InputBegan:Connect(function(inpt, gpe)

	
	if inpt.UserInputType == Enum.UserInputType.MouseButton1 then
		local hitbox = game.ReplicatedStorage.Hitbox:Clone()
		hitbox.Parent = workspace
		hitbox.Position = plr.Character.HumanoidRootPart.Position
		hitbox.WeldConstraint.Part0 = plr.Character.HumanoidRootPart
	
		
		local partsinbound = workspace:GetPartsInPart(hitbox)
		game.Debris:AddItem(hitbox, 0.3)
		for i,v: Part in pairs(partsinbound) do 
			print(v)
			if v.Name == "Ball" then
				game.ReplicatedStorage.Kickrem:FireServer(v)
				repeat
					task.wait()
				until v:GetAttribute("Owner") == plr.Name
				v:ApplyImpulse(Vector3.new(0,100,0))
				print("yes")
			end
		end
	end
	
	
end)

Thank you in advance!

After some testing I realized that it works with a touch event, but not get parts in part, which is weird

Okay I think the issue is that spacial queries use the default collision group, but I don’t know how to fix this

I fixed the bug by using overlap parameters (which I didn’t know existed lol)

1 Like

Bro why did I get flagged; dev forum community is so sensitive sometimes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.