I'm trying to write a script that simulates Mouse.hit.Position with a gui, and while I can get the result atleast once, it seems to only update the position that one time and won't get the position again
local camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character
local HRP = Character.HumanoidRootPart
local Mouse = Player:GetMouse()
HRP:WaitForChild("PseudoMouseLayout")
local PML = HRP.PseudoMouseLayout
PML:WaitForChild("PseudoCursor")
local PseudoCursor = PML.PseudoCursor
local function Get3DPosition()
local absolutePosition = PseudoCursor.AbsolutePosition
local unitRay = camera:ScreenPointToRay(absolutePosition.X, absolutePosition.Y)
local raycastResult = workspace:Raycast(unitRay.Origin, unitRay.Direction * 100)
return raycastResult.Position
end
repeat
print(Get3DPosition())
--print(Mouse.hit.Position)
task.wait(.2)
until
2 == 4```
** You are now Level 4! **