Make Mouse.TargetFilter a list instead of a single Instance

Mouse.Targetlist is a great way of ignoring certain models from being hit by the mouse.Hit value.
Link: http://wiki.roblox.com/index.php?title=API:Class/Mouse/TargetFilter

It has some drawbacks tho, you can’t use it on all players unless you put all players in a model and set targetfilter to that model. Even so, you might have some bushes and stuff that shouldn’t be targeted, then you need to choose between what to hit and what not to hit.

SURE! This can be solved with raycasting, anyone can see that. But it’s very redundant when we already do that once with mouse.Hit so it’d just waste CPU. Raycasting is also much more complicated (no don’t show me your code skills) than just doing mouse.Hit.

I feel like this is a small change with great impact that’s why I suggested it.

47 Likes

Support. Had some places it would’ve helped in 3rd person games.

1 Like

Someone went over this on another topic. I support nontheless

1 Like

This has already been discussed

1 Like

Oh, well to give a point that was not presented in that thread:
It should be added because
1: Roblox calculated mouse.Hit wether or not I use the value, doing additional raycasting is bad for performance.
2: The mouse.Hit is a SUPER simple way of getting what you want without having to do all the raycasting things.
Just like Camera:WorldToScreenPoint was added, so I think this should be upgraded to ease the development of games.

But primarily, since you already calculate the mouse.Hit object, why cant you return a value I can use instead of just wasting my cpu?

That thread was talking about making mouse.Hit have a list of targets and ignore everything else, this is talking about making mouse.Hit use something like FindPartOnRayWithIgnoreList, right now it just works like FindPartOnRay.

1 Like

Has this been shipped already? It would be a neat improvement.

3 Likes

I think this is something which still needs to be implemented. It would be very useful for developers to have this feature in Roblox where they can assign multiple instances or a table of instances to the MouseFilter without the need of a Folder.

I think its important for developers to have the ability to be able to freely add more instances. There’s an issue I’ve faced where I’d want to stop my own Character and other instances in my area from being collided when you try to place an item. An example of this would be that you have an item placement mechanism and you want to stop other items other than your item from being collidable such as another player which would be in the same place. Or even small items like your small “lighting parts” which you may use to make a realistic enlightened environment can still be collided by your mouse.

Going to bump this since I still think this is relevant.

Use a model as an argument I feel is heavily outdated, and switching / allowing this property to take a table is an overdue change that is essential for so many projects.

3 Likes

I’ve run into the need to use this feature, and I’m quite shocked it hasn’t been implemented already - it’s an undervalued feature.

The ‘TargetFilter on a model’ property is, as Mr Beary says, very outdated. I would expect for most people to utilise this feature they will need to reorganise their workspace purely to accommodate for it, which is just bad practice and annoying.

Another solution that staff could consider: Implement a new method on the mouse object, such as “Mouse:GetHit(Table of blacklisted items)”, which will get the mouse hit ignoring all of the instances specified as a table. I don’t know what would be easier to implement, but anything is better then what we currently have.

1 Like

The Mouse object is superseded by the usage of UserInputService now anyways, I don’t think Roblox will care about a MouseFilter change after years, a raycast ignore list is the best bet for now since UserInputService is more meant for use anyways (at least when you want more custom functionality).

2 Likes

We still need to raycast to Mouse.Hit.p to create the target point of a raycast for third person interactions. As far as I know, UserInputService does not replace this functionality, though if it does I would definitely love to know. If I remember correctly, then this would still be a useful addition to Roblox.

1 Like