I've been looking into learning how to raycast for quite a long time now, I've looked through many discussion threads and tutorials, I never fully understood any of them so I decided to just take a crack at it myself.
local RayIgnoreList = {Gun.Model.Muzzle} EventFired.OnServerEvent:Connect(function(plr,LookVector) local Rey = Ray.new(Gun.Model.Muzzle.Position, LookVector) local Part,position = workspace:FindPartOnRayWithWhitelist(Ray,{RayIgnoreList}) print(Part,position) local part = Instance.new("Part", workspace) part.Position = position end)
I keep getting the error "Unable to cast value to Object" I found a few different threads asking the same question, but none of those told me what exactly the error meant. So, with no alternatives Im turning to scripting helpers.