Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make Mouse.TargetFilter become multiple objects?

How can I make Mouse.TargetFilter become multiple objects?

Right now I have this coding, but that does not seem to work: (Mouse.Target.Parent is a Model, I have made sure of that earlier in the script)

for i,v in pairs(Mouse.Target.Parent:GetDescendants()) do
	if v:IsA("BasePart") then
		Mouse.TargetFilter = v
	end
end

But this does not seem to work.

How can I make the TargetFilter become multiple objects/ parts?

Any help is greatly appreciated!

1 answer

✓ Accepted answer

You can only set one thing to TargetFilter. But that can be a model, and TargetFilter will filter everything inside that model.

That means you can do this:

Mouse.TargetFilter = Mouse.Target.Parent

However, if you change the target filter in the future, Mouse.Target.Parent won't get filtered anymore, and the new one will. That might mean you need to make a model where you keep things you filter the mouse from.

1 comment

0

Thank you. I am making a placement system, like Miner's Haven, so I am using a variable for what model I am currently placing, thus making it very easy to (now) filter the objects inside the model. :-)

This discussion is preserved as it was. New answers, comments, and votes are closed.