I have a ray casting weapon in my game, but It doesn't work right. I want the ray to go through parts if they are invisible but can't figure out how...
--script I use for the ray
local ObjectHit, LocationHit = workspace:FindPartOnRay(TrajectoryRay, player.Character, false, true)
if ObjectHit.Transparency == 1 then
--what should I do here???
--1. make a new ray from LocationHit straight forward?
--2. Is there some ignore invisible parts command I could do?
end
I want this to not hit parts that are invisible, or at least act like it did not. The ray has already been created but I did not think it was important because I already have it working just not for the invisible parts.

2 comments
I think this should help. https://developer.roblox.com/api-reference/function/Workspace/FindPartOnRayWithIgnoreList
^Yes, add transparent parts to an ignorelist