I want to make a raycast function that allows you to shoot a ray through bricks that have cancollide turned off. I've tried adding the bricks to the Ignorelist and the mouse TargetFilter, and in both cases, the ray is not accurate, does not fire at the spot that the mouse is pointing to, and ends up being at an offset angle. Help?
Here's an example of how you can do this:
local ray = Ray.new(player.Lightning.WorldPosition.WorldPosition,player.HumanoidRootPart.CFrame.lookVector.unit*100) local ignore = workspace.Noncollide:GetChildren(); table.insert(ignore,player) local Part,Position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignore)
I hope this helped you.