i’m trying to insert a part into a global table but even if i switched to normal local tables it still wouldn’t work?
code:
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
_G.params = {
char,
cam,
}
params.FilterDescendantsInstances = _G.params
function visualizeRay(orig, dir, name, brickcolor, lifetime, overrideParent)
local part = Instance.new("Part", overrideParent or workspace.Misc.Debug)
table.insert(part, _G.params) -- issue
part.Name = "RaycastVisualization"
part.Transparency = .5
part.Anchored = true
part.CanCollide = false
part.CastShadow = false
if brickcolor then
part.BrickColor = brickcolor
else
part.BrickColor = BrickColor.new("Really red")
end
part.Material = Enum.Material.Neon
part.Size = Vector3.new(.1,.1,dir.Magnitude)
part.CFrame = CFrame.new(orig,orig+dir)*CFrame.new(0,0,-dir.Magnitude/2)
if name then
print(part.BrickColor.Name .. ": " .. name)
end
game.Debris:AddItem(part, lifetime or 10)
return part
end