How to detect if a part is inside of another part?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    How can I detect when a part is inside of another part?

  2. What is the issue? Include screenshots / videos if possible!
    I don’t know how to do it

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried YT and Devforum

1 Like

Try this:

local Part = game.Workspace.Part -- Your part
local RS = game:GetService("RunService")

while task.wait(0.5) do
	local result = game.Workspace:GetPartsInPart(Part,nil)
	
	print(result)
end
1 Like

Ok, i will try this and let you know if it works

hello, you could check this:

local part = your part 
local founded = false 

while wait(0.2) do
   local partsInside = workspace:GetPartsInPart(part)
   for i, part in pairs(partsInside) do
      if part ~= nil then
         founded  = true
         -- you code
      end
   end
   if not founded then
      -- your code when parts is not detected or you can jusr  remove this
   end
   founded = false
end