Problem With FilterDescendantsInstances [NOT SOLVED YET]


First of all, This code DOES not blacklist the character even tho it’s suppose to blacklist the character I assume it blacklists the folder but not the character but for reason?

How would I fix this since this can be really annoying for the player emitting blood as it can splatter onto them which isn’t suppose to happen.

You can use an alternate method by using RaycastParams.CollisionGroup and setting up collision groups:

https://create.roblox.com/docs/building-and-visuals/physics/collision-filtering

I did this so blood bits will collide with everything else except for the player but still it doesn’t work.

With Collison service you have to select all the player’s base parts, as well if your looking for a blood splatter effect you could look into particles for both simplicity and performance reasons. Ill try to find another article with info about raycasts and collision groups that better explains it.

I selected all the base parts with the collision group I have. Yes. I could do that but blood bits look more gorier as i’m going for that effect. Alright.

Also if you’re wondering I did everything right.

Also it blacklists the folder but not the character.

Are you sure ‘character’ is actually the character?
Who is firing this event? Make sure you are actually sending the character object.

I am sending the character object from the bindable event.

(I chose bindable event since modules can’t fire the fire server argument for some reason?)

I did everything correctly for the raycast params, etc. but it just doesn’t seem to blacklist the character which is really weird, since I rewrite the code and now it isn’t working anymore.

You cannot insert to the same table used for the ignoreDescendantsInstances. You will need to create a new table.

How would I create an new table? As this doesn’t work as well.


(Clicked the solution by accident.)

That’s weird. Try setting the table to {character, blood_splatter_folder} instead of using table.insert. If that doesn’t work, set the filter directly.

Alright.

#30charrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs

Didn’t work. Can you give me an example of how to set the filter directly?

Capture

Capture

It only gets the left leg for some reason?

Edit this code if you would like to make the example in the code:

connection = replicated_storage.blood_Events.handleBloodParticles.Event:Connect(function(character)
	connection:Disconnect();
	connectionTwo = stepped_event:Connect(function()
		local raycast_params = RaycastParams.new();
		raycast_params.IgnoreWater = true;
		raycast_params.FilterDescendantsInstances = {character, blood_splatter_folder}
		raycast_params.FilterType = Enum.RaycastFilterType.Blacklist;
		
		local raycast_result = _workspace:Raycast(blood_bit.Position, Vector3.new(0, -raycast_length, 0), raycast_params);

		if raycast_result and not raycast_result.Instance:FindFirstAncestorWhichIsA("Tool") then
			connectionTwo:Disconnect();
			
			print(raycast_result.Instance);

			local blood_splatter = blood_part:Clone();
			blood_splatter.Anchored = false;
			blood_splatter.CFrame = CFrame.lookAt(raycast_result.Position, raycast_result.Position + raycast_result.Normal) * CFrame.Angles(0, -math.pi/2, 0);
			blood_splatter.Parent = blood_splatter_folder;

			local blood_tween = tween_service:Create(blood_splatter, TweenInfo.new(blood_tweening_time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Size = Vector3.new(x_blood_size, random_new():NextNumber(minimum_blood_size, maximum_blood_size), random_new():NextNumber(minimum_blood_size, maximum_blood_size))});
			blood_tween:Play();

			local weld_constraint = Instance.new("WeldConstraint");
			weld_constraint.Name = "blood_weld_constraint";
			weld_constraint.Part0 = blood_splatter;
			weld_constraint.Part1 = raycast_result.Instance;
			weld_constraint.Parent = blood_splatter;

			blood_bit:Destroy();

			task.delay(blood_despawn_time, function()
				coroutine_wrap(function()
					local blood_size_tween = tween_service:Create(blood_splatter, TweenInfo.new(blood_tweening_time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Size = Vector3.new(x_blood_size, 0.001, 0.001)});
					blood_size_tween:Play();
					
					local blood_fadeout_tween = tween_service:Create(blood_splatter, TweenInfo.new(blood_tweening_time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Transparency = 1});
					blood_fadeout_tween:Play();
					
					blood_size_tween.Completed:Connect(function()
						blood_splatter:Destroy();
					end);
				end)();
			end);
		end
	end);
end)

I have instead come up with my own solution. And it works perfectly! Thank you for helping me @SubtotalAnt8185!