Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make Mouse.TargetFilter become multiple objects?

Asked by
nanaluk01 247 Moderation Voter
6 years ago
Edited 6 years ago

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

Log in to vote
1
Answered by
CootKitty 311 Moderation Voter
6 years ago

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.

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. :-) nanaluk01 247 — 6y
Ad

Answer this question