Although this sounds vague,
I have a part that I want the player to touch but Roblox says it’s nil but it’s clearly in the workspace.
here is a demonstration:
basically the part is nil in the script even though I’m using the same method as the v:FindFirstChild('Hitbox') and I’ve tried it with other parts within the door and same thing, it says it’s nil(although it didn’t show in the output in the video, it does say it’s nil)
and here is my code for the part and an image of the workspace:

local controls = require(plr.PlayerScripts:WaitForChild('PlayerModule'):WaitForChild('ControlModule'))
local effects = plrg:WaitForChild('effects')
local iris = effects.iris.iris
local irisTrigger = iris.Trigger
local misc = RES.misc
local classic_sky = misc:WaitForChild('classic_sky')
local interior_sky = misc:WaitForChild('interior_sky')
local doors = workspace.interact.door
local doorDebounce = false
local interiorDebounce = false
local isInterior = false
local function MoveToPart(destination: BasePart)
hum:MoveTo(destination.Position)
hum.MoveToFinished:Wait()
end
for _, v in pairs(doors:GetChildren()) do
if v:IsA('Model') and v:FindFirstChild('Hitbox') and v:FindFirstChild('back') then
local hitbox: BasePart = v:FindFirstChild('Hitbox')
local hitboxBack: BasePart = v:FindFirstChild('back'):FindFirstChild('HitboxBack')
hitbox.Touched:Connect(function(hit)
local hum: Humanoid = hit.Parent:FindFirstChild('Humanoid')
if hum and not doorDebounce and not isInterior then
doorDebounce = true
isInterior = true
controls:Disable()
v:FindFirstChild('Main').CanCollide = false
MoveToPart(v:WaitForChild('MoveTo'))
local sky = interior_sky:Clone()
sky.Parent = game:GetService('Lighting')
game:GetService('Lighting'):WaitForChild('classic_sky').Parent = game:GetService('Lighting').level
hrp.CFrame = v:FindFirstChild('Location').CFrame
irisTrigger:Fire(0.25)
task.wait(1)
controls:Enable()
task.wait(5)
doorDebounce = false
end
end)
hitboxBack.Touched:Connect(function(hit)
local hum: Humanoid = hit.Parent:FindFirstChild('Humanoid')
if hum and isInterior then
isInterior = false
controls:Disable()
v:FindFirstChild('Main').CanCollide = false
local sky = classic_sky:Clone()
sky.Parent = game:GetService('Lighting')
game:GetService('Lighting'):WaitForChild('interior_sky').Parent = game:GetService('Lighting').level
hrp.CFrame = v:FindFirstChild('back'):FindFirstChild('Back').CFrame
irisTrigger:Fire(0.25)
task.wait(1)
controls:Enable()
isInterior = false
end
end)
end
end


