As a roblox developer, making projectiles is a pain in the butt. This first step would to be to get the position of the player’s mouse in CFrame form, which can be accomplished with Mouse.Hit
. Great! However, what if you want objects to be ignored? Mouse.TargetFilter
! It’s great!
This is where my problem arises: MOUSE.TARGETFILTER
CAN ONLY BE ONE INSTANCE! I get it. It’s deprecated. But why? I know you can raycast to get the same result, but that’s also a hassle and can be fixed with this suggestion:
Here’s my request, for all my projectile-making-homies out there: Allow Mouse.TargetFilter to be a table. I will now list the use cases:
- Allowing devs to add debris and characters to the filter in real time! Reparenting characters and debris to a massive model is a no-go.
mouse = game.Players.LocalPlayer:GetMouse()
game:GetService('RunService'):BindToRenderStep('AlexBro', Enum.RenderPriority.Last.Value + 1, function()
local newFilter = {workspace.ThisPart, workspace.ThatPart}
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character and v ~= game.Players.LocalPlayer then
table.insert(newFilter, v.Character) -- add their character to the ignore filter
end
end
-- WOW! THE TARGET FILTER IS A TABLE!
mouse.TargetFilter = newFilter
end)
- Allowing multiple instances to be filtered without a model.
- Saving developers from using more of the device’s resources making raycasts when its ALREADY BEING DONE INTERNALLY WITH MOUSE.HIT
- Saving developers blood, sweat, and tears
Thank u devrel/people on the forum for reading my post
P.S. Look, even big man merely wanted this…