Help scripting a minimap

I’m scripting a minimap and my current code is this:

local run = game:GetService("RunService")
local Players = game:GetService("Players")

local mapCoverage = {
	Size = Vector3.new(9552, 0, 8928)
}

local scale = 1/1200

local minimap = script.Parent
local plr = Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")

run.RenderStepped:Connect(function()	
	local hrpX = hrp.Position.X * scale
	local hrpZ = hrp.Position.Z * scale
	
	minimap.Position = UDim2.new(hrpX, 0, hrpZ, 0)
end)

However this isn’t accurate, do you have any helpful tips to make it more accurate? It currently shows me in wrong places.

2 Likes

Sorry could you tell whats wrong? or what you want to do?

I think I gave enough info. It isn’t accurate and I need some help with calibrating/modifying it for precision.

I updated the topic with some more information and I still need an answer for this.

What do you want the code to actually do? Have you tested the code to see if it works?

Of course I did. Can you please read the thread before asking?