Hello, I am trying to make the player face the gui frame (cursor is a frame stored within a billboard stored within the player's humanoid root, real cursor is locked to the middle of the screen so I cannot use that.) but i'm not having much luck, is there something i'm missing?
#How to make player face gui element
1 messages · Page 1 of 1 (latest)
I believe ur gonna need to use remote functions
so like what
** You are now Level 3! **
local Player = game.Players.LocalPlayer
local Character = Player.Character
local HRP = Character.HumanoidRootPart
local Mouse = Player:GetMouse()
RunService.RenderStepped:Connect(function()
local MousePos = Mouse.Hit.Position
local HRPPos = HRP.Position
MousePos = Vector3.new(MousePos.X, HRPPos.Y, MousePos.Z)
HRP.CFrame = CFrame.new(HRPPos, MousePos)
end)```
This was the script used for the original mouse, and i've been made aware of this script to supposedly replicate Mouse.Hit.Position
local myDotGui = script.Parent.Whatever
local function Get3DPosition()
local absolutePosition = myDotGui.AbsolutePosition
local unitRay = currentCamera:ScreenPointToRay(absolutePosition.X, absolutePosition.Y)
local raycastResult = workspace:Raycast(unitRay.Origin, unitRay.Direction * 100)
return raycastResult.Position
end
print(Get3DPosition())```