I am making an npc which shoots even if there is a wall between the target and the npc.
How to make it so that it only shoots if its vacant between the npc's head and target?? Any help would be Highly Appreciated. Thanks in Advance.
I am making an npc which shoots even if there is a wall between the target and the npc.
How to make it so that it only shoots if its vacant between the npc's head and target?? Any help would be Highly Appreciated. Thanks in Advance.
local function CheckBetween2Points(Point1:BasePart,Point2:BasePart)
local vector = (Point2.CFrame.Position - Point1.CFrame.Position).Unit
return workspace:Raycast(Point1.Position,vector*100)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
raycasting