Hey. I'm looking for how to get the local player's mouse position in Vector2 value and not in Vector3. I will make sure to ACCEPT the helpful comment!
There are many ways you can do this, you can use the Mouse's X and Y properties, or UserInputService
.
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() print(Mouse.X, Mouse.Y)
local UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function(Input, GPE) if GPE then return end print(Input.Position.X, Input.Position.Y) end) UserInputService.InputChanged:Connect(function(Input, GPE) if GPE then return end print(Input.Position.X, Input.Position.Y) end) UserInputService.InputEnded:Connect(function(Input, GPE) if GPE then return end print(Input.Position.X, Input.Position.Y) end)