not sure whats going on here wached a video, and did everything he did but seems, to not work I had it working, the first time but when I went to save studio crashed and didn't save,
local ray = Ray.new(script.Parent.Position,Vector3.new(0,100,0)) while wait(1) do local hit,position = workspace:FindPartOnRayWithIgnoreList(ray,(script.Parent)) if hit then print(hit.Name) local p = Instance.new("Part",workspace) p.Anchored = true p.CFrame = CFrame.new(position) p.Size = Vector3.new(1,1,1) game:GetService("Debris"):AddItem(p,1) end end
Your error is when defining the ignore list for your raycast.
The method takes an array of objects to be ignored, and you provided it with a single object.
You'll need to change
workspace:FindPartOnRayWithIgnoreList(ray,(script.Parent))
to
workspace:FindPartOnRayWithIgnoreList(ray, {script.Parent})
Hopefully this works for you!