Hello! I want my square to be on the player when he spawns in. I’ve learned to accurately track the player’s movement after I think. I just don’t know how to convert the player’s location to a Gui position like at the start of the game.
Supposed to be at the player’s location which would look like this
https://gyazo.com/86cfa316215d97d24afd942e74413be6
but is here
https://gyazo.com/6a777c22056ca0f617c2e2f19375ab88
I’m very new at this kind of coding with minimaps and everything.
The code I have right now
local rs = game:GetService("RunService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local root = char:WaitForChild("HumanoidRootPart")
local mapImage = script.Parent.Frame
local originUDim2 = UDim2.fromScale(0.57, 0.32)
local originV3 = Vector3.new()
local xFactor = 0.00040787799
local zFactor = 0.00040787799
rs.Heartbeat:Connect(function()
local delta = originV3 - root.Position
local deltaX = delta.X * xFactor
local deltaZ = delta.Z * zFactor
mapImage.Position = originUDim2 - UDim2.fromScale(deltaX, deltaZ)
end)
Any help is appreciated!