How could I set the mouse.TargetFilter to contain two things? I'm making a block placing system, so I need to filter out the block that is currently being placed AND the player.
COMMUNITY QUESTION
Multiple target filter objects?
1 answer
PlayerMouse.TargetFilter can be an instance, and filters out the instance and all of its descendants. The first solution would be to have everything you want to filter be in the same parent.
If your problem was more general, you could take everything you want to filter, record their original parents, and then parent them to some model created in the script, set that model to the target filter, and at the end you can set everything back to their original parents.
However, it sounds like your problem is a bit more specific. In this case, I would recommend this:
- Place the block currently being placed in the character model (i.e.
block.Parent = player.Character). - Set
mouse.TargetFilter = player.Characterat the start.
Now the mouse should not recognize your character or the block being placed.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
The player is automatically filtered.