"Remote event invocation queue exhausted; did you forget to implement OnClientEvent?" Error

Also in my original script some specific particles had different transparent values from eachother so making them all have the same same value kinda breaks it

I tested exactly the same code I sent and works for me:

I explained that on my reply:

That can be tackled easily, but, the first step is making it to work, then the details

a video:

This is what it looks like on my game. Idk what to do because it works for you and doesn’t for me. Maybe it’s the transparency value issue, and idk how to fix it


What it’s supposed to look like is that snow would fall from camerapart2 which is above the player and moves with the camera, and camerapart emits a fog particle. When the raycast detects a part they are not disabled but their transparency is turned off

This is an improved version of the script I just made. Now it takes in count the starter values of your Particles. If your particles from the start has the right values to be visible, those will be stored in a table to be used to turn on the particles with those exact values.

And includes a debounce for not constantly repeating the entire function if theres no real change from the raycast loop:

Try it, if you could send a video that includes the Output would be better.

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local particleTable = {}

for _, particle in pairs(game.Workspace:WaitForChild("CameraPart2"):GetChildren()) do
	if particle:IsA("ParticleEmitter") then
		particleTable[particle] = particle.Transparency
	end
end

local raycastParams = RaycastParams.new();
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist;
raycastParams.FilterDescendantsInstances = {player.Character};
raycastParams.CollisionGroup = "Default"

local Debounce -- debounce to avoid constantly run the update function with each loop iteration

local function updateParticles(eventName)
	if Debounce ~= eventName then
		Debounce = eventName
		local numbSeq
		if eventName then
			warn("hide particles")
			numbSeq = NumberSequence.new{NumberSequenceKeypoint.new(0,1), NumberSequenceKeypoint.new(1,1)} -- is this disabled?
			for particle, _ in pairs(particleTable) do
				particle.Transparency = numbSeq
			end
		else
			warn("show particles")
			for particle, value in pairs(particleTable) do
				particle.Transparency = value
			end
		end
	else
		-- do nothing
	end
end

task.spawn(function()
	while task.wait(0.1) do
		if player.Character ~= nil then
			local ray = workspace:Raycast(character:WaitForChild("HumanoidRootPart").Position, Vector3.new(0, 15, 0) * 100, raycastParams);
			if ray then
				if ray.Instance:IsA("BasePart") then
					updateParticles(true)
				end
			else
				updateParticles(false)
			end
		end
	end
end)

One thing I didnt notice until I saw your video, is that you have the Particles in 2 different Parts, one called CameraPart and CameraPart2. The script I sent, its only working for the CameraPart2 Particles.
You could place all particles inside the same part or add an interation for the CameraPart too in the script, so both are taken in count

They’re in 2 different parts because one is at the top and one is at the left side


I tried the script and this is the only thing related to it in output but the particles in camerapart2 were invisible the entire time. Their transparency wasn’t being toggled

Sure, if you cant place all particles inside the same part, then as I mentioned before, you just need to add a second loop for the other CameraPart, and thats it

-- for CameraPart
for _, particle in pairs(game.Workspace:WaitForChild("CameraPart"):GetChildren()) do
	if particle:IsA("ParticleEmitter") then
		particleTable[particle] = particle.Transparency
	end
end
-- for CameraPart2
for _, particle in pairs(game.Workspace:WaitForChild("CameraPart2"):GetChildren()) do
	if particle:IsA("ParticleEmitter") then
		particleTable[particle] = particle.Transparency
	end
end

The prints are there, which means its working, but if still not working on your side, if its not too much to ask, could you send me the particles only as a file to import? so I can test it with your particles?

Also I noticed that in in the loading screen, the snowflake particles are visible but when I load in the actual game their transparency is 1. Could this mean that the reycasting is detecting camerapart2?

Yup, theres a chance that CameraPart2 if thats the part above the character and its not included into the blacklist of the params of the raycast, then yeah, it hitting that part and its been considered as the “ceil” so particles becomes invisible

OMG I am so stupid. It was detecting camerapart2 the whole time because it was above me and it was following the camera. I just turned canquery off for the part and the problem is fixed. Thank you so so so much and I am so sorry for wasting your time

1 Like

Sorry for not reading the params of your raycast I supposed the CameraPart2 was included there xD

Nah, its not a waste of time, I have fun doing this and you now have a more dynamic script to work with :yum:

1 Like

Also one more thing, the reason I changed the script in the first place doesn’t seem to work. I separated the trees into their own collision groups but the raycasting seems to detect them even tho in the params.collisiongroup it’s set to default

If the collision group of the raycast params is Default, and the trees are in a different group idk “trees group”, will be ignored if theres no interaction between default and trees, you set that into the group manager menu.

Look, I set my “roof” part to a collision group called trees, and trees doesnt have iteraction with default, raycast is on default, as you can see now the raycast ignores my roof part

The groups manager, trees doesnt iteract with default:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.