I was told a while ago, player:GetMouse() was going to be deprecated and to use UIS for now on. Is this a valid statement or should I use either one depending on the project?
Both works, I recommend UserInputService
Example for UserInputService - from this website
local UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 then print("The left mouse button has been pressed down at",input.Position) end end)
(Needs to be a LocalScript)
Example for player:GetMouse() - from this website
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Button1Down:Connect(function() print("Button 1 is down") end)
(Needs to be a LocalScript too)
As you can see, with UIS you can even get the position where player clicked, and I don't think you can do that with GetMouse().
Hope this helps!