Hello! I’m working on a first person shooter game and I was wondering if I could make the ray go through bullet holes? I tried using FindPartOnRayWithIgnoreList but it didn’t work. The ray just stops when it hits a bullet hole. Code:
local RayCast = Ray.new(
bruh, -- vector3 of the mouse
(ToP-bruh).unit*500
)
local ignoreList = workspace.bh:GetChildren() -- folder with all the bullet holes
table.insert(ignoreList,plr.Character) -- player's character
local Part,Position,Normal = game.Workspace:FindPartOnRayWithIgnoreList(RayCast,ignoreList, false,true)
if Part then
print(Part.Name)
local Dist = (ToP-bruh).magnitude
if not Dist then Dist = 300 end
local Hole = game.ReplicatedStorage.Hole:Clone()
Hole.Parent = workspace.bh
Hole.Position = ToP
Hole.CFrame = CFrame.new(Hole.Position, Hole.Position+Normal)
game.Debris:AddItem(Hole,3)
Any help would be very appreciated! ![]()