Raycast not excluding?

				local function RandomPosition(Part, WhatPartsPositionToChange)

					local XvectorMin = (Part.Position - (Part.Size / 2)).X
					local XvectorMax = (Part.Position + (Part.Size / 2)).X


					local YvectorMin = (Part.Position - (Part.Size / 2)).Y
					local YvectorMax = (Part.Position + (Part.Size / 2)).Y


					local ZvectorMin = (Part.Position - (Part.Size / 2)).Z
					local ZvectorMax = (Part.Position + (Part.Size / 2)).Z

					WhatPartsPositionToChange.Position = Vector3.new(math.random(XvectorMin,XvectorMax),math.random(YvectorMin,YvectorMax),math.random(ZvectorMin,ZvectorMax))

					return WhatPartsPositionToChange.Position

				end

				local Part = Instance.new("Part",workspace.Ignore)

				Part.Transparency = 1
				Part.Anchored = true

				Part.CanCollide = false

				local Pos = RandomPosition(RainSpawnArea, Part)

				game.Debris:AddItem(Part, 0.5)
				
				local IgnoreList = {workspace.DynamicWeather, workspace.Ignore, Player.Character}
				
				local RaycastParameters = RaycastParams.new()
				
				RaycastParameters.FilterDescendantsInstances = IgnoreList
				RaycastParameters.FilterType = Enum.RaycastFilterType.Exclude
				
				local RaycastResult = workspace:Raycast(Pos, Vector3.new(Pos.X,Pos.Y - 500,Pos.Z))
				
				if RaycastResult then
					
					local NewPart = Instance.new("Part",workspace)
					local SplashClone = script:WaitForChild("SplashParticle"):Clone()
					
					local SplashClone3D = script:WaitForChild("SplashParticle3D"):Clone()
					
					table.insert(IgnoreList, (#IgnoreList + 1), NewPart)
										
					NewPart.Anchored = true
					NewPart.CanCollide = false

					NewPart.Position = Vector3.new(RaycastResult.Position.X,RaycastResult.Position.Y + 0.1,RaycastResult.Position.Z)
					NewPart.Transparency = 1
					
					NewPart.Size = Vector3.new(
						20,
						0,
						20
					)
					
					SplashClone.Parent = NewPart
					SplashClone3D.Parent = NewPart
					
					spawn(function()

						SplashClone.Enabled = true
						SplashClone3D.Enabled = true
						
						spawn(function()
							
							wait(0.1)
							
							SplashClone.Rate = 0
							SplashClone3D.Rate = 0
							
						end)

						wait(0.45)
						NewPart:Destroy()
						SplashClone.Enabled = false
						SplashClone3D.Enabled = false

					end)

				end

My raycast is completely ignoring the ignore list.

1 Like

You didn’t add the third parameter which is the Racyastarams

image

2 Likes
local RaycastResult = workspace:Raycast(Pos, Vector3.new(Pos.X,Pos.Y - 500,Pos.Z),RaycastParameters)

I added it, and it is continuing to not ignore the “Ignore” folder in workspace. Does it ignore only the folder or does it ignore its children too? Perhaps that is the problem.

What do you mean by “excluding”?

The ray should be ignoring parts listed in the ignore list, but its not unfortunately. I have no idea why it isn’t and people in several servers don’t either.

Can you please send me the SplashParticle and the DynamicWeather models?

This should work:

local function RandomPosition(Part, WhatPartsPositionToChange)

	local XvectorMin = (Part.Position - (Part.Size / 2)).X
	local XvectorMax = (Part.Position + (Part.Size / 2)).X


	local YvectorMin = (Part.Position - (Part.Size / 2)).Y
	local YvectorMax = (Part.Position + (Part.Size / 2)).Y


	local ZvectorMin = (Part.Position - (Part.Size / 2)).Z
	local ZvectorMax = (Part.Position + (Part.Size / 2)).Z

	WhatPartsPositionToChange.Position = Vector3.new(math.random(XvectorMin,XvectorMax),math.random(YvectorMin,YvectorMax),math.random(ZvectorMin,ZvectorMax))

	return WhatPartsPositionToChange.Position

end

local Part = Instance.new("Part",workspace.Ignore)

Part.Transparency = 1
Part.Anchored = true

Part.CanCollide = false

local Pos = RandomPosition(RainSpawnArea, Part)

game.Debris:AddItem(Part, 0.5)

local IgnoreList = {workspace.DynamicWeather, workspace.Ignore, Player.Character}

local RaycastParameters = RaycastParams.new()

RaycastParameters.FilterDescendantsInstances = IgnoreList
RaycastParameters.FilterType = Enum.RaycastFilterType.Exclude

local RaycastResult = workspace:Raycast(Pos, Vector3.new(Pos.X,Pos.Y - 500,Pos.Z),RaycastParameters)

if RaycastResult then

	local NewPart = Instance.new("Part",workspace.Ignore)
	local SplashClone = script:WaitForChild("SplashParticle"):Clone()

	local SplashClone3D = script:WaitForChild("SplashParticle3D"):Clone()


	NewPart.Anchored = true
	NewPart.CanCollide = false

	NewPart.Position = Vector3.new(RaycastResult.Position.X,RaycastResult.Position.Y + 0.1,RaycastResult.Position.Z)
	NewPart.Transparency = 1

	NewPart.Size = Vector3.new(
		20,
		0,
		20
	)

	SplashClone.Parent = NewPart
	SplashClone3D.Parent = NewPart

	spawn(function()

		SplashClone.Enabled = true
		SplashClone3D.Enabled = true

		spawn(function()

			wait(0.1)

			SplashClone.Rate = 0
			SplashClone3D.Rate = 0

		end)

		wait(0.45)
		NewPart:Destroy()
		SplashClone.Enabled = false
		SplashClone3D.Enabled = false

	end)

end
1 Like


its still doing the weird stack thing…

Can you give me access to the studio by any chance?

Gotcha. Friend me please. (this is me trying to get past the chr limit)

You now have access to the game.