So, I have this one script that gets the mouse X however I need it to get the X in Scale instead of pixels. How is it possible to change that up?
local Players = game:GetService("Players") local player = Players.LocalPlayer local mouse = player:GetMouse() function moyse() local position = mouse.X print(position) return position end mouse.Move:Connect(moyse)
As y'know, the Scale of a gui's position or size is represented as a decimal of the percentage of the gui's position divided by that of its parent's.
You can calculate scale by: (dimensionPos / parentDimensionPos)
The mouse will be the gui, and the screen will be the parent
In your case, this'll be:
local scale = position / workspace.CurrentCamera.ViewPortSize.X