I have no clue as to how to do this... I tried this (sample code)
local ray = Ray.new(pos1,(pos2-pos1).unit*750) local ignores = {game.Player.Player1.Character,game.Workspace.Inbetween} local hit,pos = game.Workspace:FindPartOnRay(ray,ignores)
but I didn't seem to work. Any tips or code you guys can offer me?
To ignore multiple objects when finding a part on a ray, you need to use FindPartOnRayWithIgnoreList. FindPartOnRay only accepts one instance, while FindPartOnRayWithIgnoreList accepts an array of instances to ignore when finding a part on the line of a ray.
local ray = Ray.new(pos1,(pos2-pos1).unit*750) local ignores = {game.Player.Player1.Character,game.Workspace.Inbetween} local hit,pos = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignores) --Finds a part on the ray with the current ray and ignores the instances in the ignores array.
I hope my answer helped you. If it did, be sure to accept it.