I have a script and when i begun the script i was using raycast but halfway through i switched to spherecast, I kept the same params because i didnt really think it would affect anything but now it just hits the players character everytime.
Any way to fix this??
local direction = (Target.Position - HumRoot.Position).Unit
local raycastParams = RaycastParams.new()
for i, part in pairs(char:GetDescendants()) do
if part:IsA("BasePart") then
raycastParams.FilterDescendantsInstances = {part}
end
end
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
local raycast = workspace:Shapecast(shield.PrimaryPart, direction * 50, raycastParams)
if raycast then
print(raycast.Instance)
end