i’ve looked everywhere and couldn’t find any solutions to this problem
i have a script that constantly checks if there’s a wall in front of a part via raycasting but it only seems to fire when the part was only just created
not the full script, if you need more just let me know, there’s an extra tween that moves the object which is why it says tween:Pause()
(orb is the part, orbs is the folder)
local wallCheck = coroutine.create(function()
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {script.Parent, workspace.PartsToFilter, target.Character}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
while orb.Activated.Value == true do
local raycastResult = workspace:Raycast(orb.Position, orb.CFrame.LookVector * 5, raycastParams)
if raycastResult then
tween:Pause()
local destroyGoal = {}
destroyGoal.Transparency = 1
local destroyInfo = TweenInfo.new(0.25, Enum.EasingStyle.Linear)
local destroyTween = TweenService:Create(orb, destroyInfo, destroyGoal)
destroyTween:Play()
orb.Activated.Value = false
wait(0.25)
orb.Parent = orbs
break
end
wait()
end
end)
coroutine.resume(wallCheck)
In your FilterDescendantsInstances, you add script.Parent.
Is the script.Parent in this instance the workspace? Then you’re blacklisting everything within the workspace.
If you could, add a print(script.Parent) before you assigned FilterDescendantsInstances
for some reason it seems to only hit stuff when it was first created and then it just starts ignoring stuff, i’ve even put a print to see if the loop is repeating and it is
huh. it seems that when it’s only the one part on its own it acts fine. what i’m doing is i’m making it spam parts towards the player but it seems to work when there’s only one part