local endHitbox = false
task.spawn(function()
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.IgnoreWater = false
raycastParams.FilterDescendantsInstances = {newFirePart, workspace.Ignore, workspace.Characters}
--[[local overlapParams = OverlapParams.new()
overlapParams.FilterType = Enum.RaycastFilterType.Blacklist
overlapParams.FilterDescendantsInstances = {workspace.Ignore}]]
while not endHitbox do
raycastParams.FilterDescendantsInstances = {workspace.Ignore, workspace.Characters}
--overlapParams.FilterDescendantsInstances = {workspace.Ignore}
local rayResult = workspace:Raycast(newFirePart.Position, Vector3.new(0, -1.5, 0), raycastParams)
if rayResult then
newFirePart.Anchored = true
else
newFirePart.Anchored = false
end
--[[local resultArray = workspace:GetPartsInPart(newFirePart, overlapParams)
newFirePart.Anchored = false
for i, v in pairs(resultArray) do
if v:IsDescendantOf(workspace.Characters) then continue end
newFirePart.Anchored = true
end]]
runService.PreSimulation:Wait()
end
end)
I also tried to use :GetPartsInPart() and .Touched its just reacts to the part too slowly and late