game:GetService("RunService"):BindToRenderStep("ORayPosAndDetect", 294, function()
local TouchingParts = ORay:GetTouchingParts()
task.wait()
ORay.CFrame = Camera.CFrame:ToWorldSpace(CFrame.new(0, 0, -5))
if not table.find(TouchingParts, CurrentTouchingPart) and CurrentTouchingPart then
CurrentTouchingPart.BillboardGui.Enabled = false
CurrentTouchingPart = nil
end
for i, v in pairs(TouchingParts) do
if v.Name == "fronticon" then
v = CurrentTouchingPart
v.BillboardGui.Enabled = true
end
end
end)
The code is meant to show an “interact” icon to open a drawer inside a cabinet, however when I test this out in game it gives me that the instance is nil for some reason
But when I print out if the variable is actually nil or instance, it actually gives me the logical results
print(v)
print(v:GetFullName())
print(typeof(v))
Do you guys have any idea what’s going on?