[SOLVED] Raycast not working properly

unfortunately that did not do anything, even with only one part it still went through the wall

As far as my own testing goes, it works fine.
Can you test it with no filter? Except the orb part.

I just did:
raycastParams.FilterDescendantsInstances = {orb}

alright i’ll try, hopefully it works

still didn’t work, i’ll try some stuff and if it doesn’t work i don’t know what else to do

Could you give a screenshot of what the orb looks like along with explorer?

the orb itself is just a red sphere, anchored and cancollide false, i might just send the whole script, give me one sec, i’ll also give you a screenshot of the explorer

explorer

TweenService = game:GetService("TweenService")

while #game.Players:GetChildren() == 0 do
	
	wait()
	
end

target = game.Players:FindFirstChildWhichIsA("Player")

while not target.Character do
	
	wait()
	
end

wait(5)

for i = 0, 75 do
	
	newOrb = script.Orb:Clone()
	newOrb.Parent = orbs
	
end

while wait(0.2) do
	
	orbs = script.Parent.Orbs
	
	if #orbs:GetChildren() == 0 then
		
		newOrb = script.Orb:Clone()
		newOrb.Parent = orbs
		
	end
		
	orb = orbs:FindFirstChild("Orb")
	orb.Position = script.Parent:FindFirstChild("HumanoidRootPart").Position -- + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)) + script.Parent:FindFirstChild("HumanoidRootPart").CFrame.LookVector * 5 + Vector3.new(0,1,0)

	orb.CFrame = CFrame.lookAt(orb.Position, target.Character:FindFirstChild("HumanoidRootPart").Position)
	
	--orb.Orientation += Vector3.new(math.random(-8,8),math.random(-8,8),math.random(-8,8))

	goal = {}
	goal.Position = orb.Position + orb.CFrame.LookVector * 500

	info = TweenInfo.new(8, Enum.EasingStyle.Linear)

	tween = TweenService:Create(orb, info, goal)

	orb.Parent = workspace.PartsToFilter
	orb.Transparency = 0

	tween:Play()
	
	orb.Activated.Value = true
	orb.Damage.Value = 25
	
	local wallCheck = coroutine.create(function()
		
		local raycastParams = RaycastParams.new()
		
		raycastParams.FilterDescendantsInstances = {script.Parent, workspace.PartsToFilter, target.Character}
		raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
		
		while true do
			
			--print(orb.Position)
			
			local raycastResult = workspace:Raycast(orb.Position, orb.CFrame.LookVector * 5, raycastParams)
			
			--local raycastResult = workspace:Raycast(
			--	orb.Position,
			--	CFrame.new(
			--		orb.Position,
			--		(orb.CFrame * CFrame.new(1, 0, 0)).Position
			--	).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)
	
end

oh yeah and the orbs contain 2 values. a bool value called activated and a number value called damage which tells how much damage the player should take upon making contact with it

alright i’ve figured out when the problem starts. it happens when there’s more than one orb.

found the solution after playing around a bit.