For some reasing raycasting shows me the wrong result, as clearly written in filterdescendantsinstances (written correctly) and with filertype set to exclude it still for some reason outputs an instance INSIDE of the excluded part, im going insane what have i done wrong
Server Script:
-- Variables
local remote = game:GetService("ReplicatedStorage").Remotes.Weapons.GravityGun
---- MAIN ----
remote.OnServerEvent:Connect(function(plr)
local char = plr.Character
if char then
local tool = char:FindFirstChildOfClass("Tool")
if tool and tool.Name == "Gravity Gun" then
---- GETTING VARS ----
local shotTick = tool:FindFirstChild("shotTick")
local shoot = tool:FindFirstChild("Shoot")
local camCF = plr:FindFirstChild("camCF")
if shotTick and camCF and shoot and shotTick:IsA("NumberValue") then
if tick() - shotTick.Value >= .4 then
---- RAYCASTING ----
print(tool.MeshPart:GetFullName())
local ray = game:GetService("Workspace"):Raycast(shoot.Position, camCF.Value.LookVector * 100, RaycastParams.new({FilterDescendantsInstances = {tool}, FilterType = Enum.RaycastFilterType.Exclude}))
if not ray or not ray.Instance then
return;
end
---- PROJECTING BULLET ----
print(ray.Instance:GetFullName())
---- ESTABLISHING COOLDOWN ----
shotTick.Value = tick()
end
end
end
end
end)
^
outputs
Workspace.Cooldoodle2019.Gravity Gun.MeshPart
twice
please fix roblox im tired of broken raycasting