Mini map problems

Please note this is my first post, so if there is anything that needs redone, or said a different way, please let me know.

  1. What do I want to achieve?
    I want to make a mini map that works similar to the islands’ treasure map.
    Basically a mini map that tracks the player’s character’s position and displays that onto a UI object.

  2. What is the issue?
    I can’t seem to figure this out. I have tried, calculated, and tried again, but it is still not working. So maybe you can help.
    I have a 250 by 250 stud map, and a UI frame. So I need to display the character’s position’s X and Y into a UI object’s Position’s X and Y scale.

  3. What solutions have you tried so far?
    I have tried all the normal things. I have searched for related articles on the devforum. When I could not find anything useful, I turned to YouTube tutorials, again all they had was a small mini map that follows the player’s character. What I need is a map that does not move. Only the character’s icon moves on it. I also have tried to put a part into the ViewPortFrame and set it to the player’s character’s position. This causes a lot of lag.

after many hours, this is the best got:

local textlabel = script.Parent.TextLabel
local player = game.Players.LocalPlayer

while wait(1) do
	local character = player.Character
	local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	if HumanoidRootPart then	
		local position = HumanoidRootPart.Position
		textlabel.Position = UDim2.new(position.X/101.125,0,position.Z/101.125,0)
	end
end

and here’s what it does:

Any help would be greatly appreciated.

local textlabel = script.Parent.TextLabel
local player = game.Players.LocalPlayer
local MapGUIsize = ???
while wait(1) do
	local character = player.Character
	local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	if HumanoidRootPart then	
       local X =HumanoidRootPart.Position.X/125         --- divided by 125 as that is half the map size.
     local Y = HumanoidRootPart.Position.Z/125
		local position = HumanoidRootPart.Position
		textlabel.Position = UDim2.new(X,0,Y,0)
	end
end

Make sure that the anchor point of the pointer is at vector2.new(0.5,0.5)

The anchor point is set to 0.5,0.5

Still not working.

Where is the middle of the map? It has to be at the vector 0,0,0.

middle of the map is 0,0,0. It appears that the object is moving across the screen to much.

Oh yeah i made a mistake, this should work:

local textlabel = script.Parent.TextLabel
local player = game.Players.LocalPlayer
local MapGUIsize = ???
while wait(1) do
	local character = player.Character
	local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	if HumanoidRootPart then	
       local X =(HumanoidRootPart.Position.X+125)/250
     local Y = (HumanoidRootPart.Position.Z+125)/250
		local position = HumanoidRootPart.Position
		textlabel.Position = UDim2.new(X,0,Y,0)
	end
end

Also set anchor point to vector2.new(0,0)

Now it’s even worse.

I think the problem might be that there is no negative number in the UI position scale, but there is one in the character’s position.

Well, You can use my modular minimap creator that allows you to create minimap in easier way

and as i see, you made the player tracker image on the minimap updates every second

so you can do this by editing my module and replace the RunService with while loop

Thanks.

Sadly this is not what i’m looking for. I need a minimap that does not move. I need the character’s icon to move.

I have edited this so that there should be no negatives.

Now the icon has gone off the screen.

Is the anchor point on 0,0??? Cause it should never go over 1 scale if your map is really 250 studs.

Yeah I said the anchor point should be 0,0.

Oops! I’m so sorry. The map is 500 by 500. I don’t know how I overlooked this!

Try this

local textlabel = script.Parent.TextLabel
local player = game.Players.LocalPlayer
local MapSize = 500
while wait(1) do
	local character = player.Character
	local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	if HumanoidRootPart then	
       local X =(HumanoidRootPart.Position.X+(MapSize/2))/MapSize
     local Y = (HumanoidRootPart.Position.Z+(MapSize/2))/MapSize
		local position = HumanoidRootPart.Position
		textlabel.Position = UDim2.new(X,0,Y,0)
	end
end

The anchor point should be 0,0 too

1 Like

Thank you, so much! I need to adjust the map a little and it should work great! Thanks again. God bless