Title explains it all. My raycast should be getting a result, but it isn’t (it’s parameters are just everything in the workspace)
local part = workspace.red
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Whitelist
Params.IgnoreWater = true
Params.FilterDescendantsInstances = {workspace}
local function createTracer(startpos)
local RayDirection = startpos + Vector3.new(math.random(-30, 30), math.random(-30,30), math.random(-30, 30))
local result = workspace:Raycast(startpos, RayDirection, Params)
if result then
local hit = result.Instance
local endpos = hit.Position
local distance = (startpos - endpos).Magnitude
local tracer = Instance.new("Part")
tracer.Color = Color3.fromRGB(163, 162, 165)
tracer.Material = Enum.Material.Neon
tracer.Anchored = true
tracer.CanCollide = false
tracer.Size = Vector3.new(0.5, 0.5, distance)
tracer.CFrame = CFrame.new(startpos , endpos) * CFrame.new(0, 0, distance/2)
tracer.Parent = workspace
spawn(function()
for i = 1, 100 do
tracer.Transparency = tracer.Transparency + 0.01
wait(0.01)
end
tracer:Destroy()
end)
end
end
for i = 1, 15 do
createTracer(part.Position)
wait(0.05)
end