Hello so, I edited a bit of a code someone made, to make it work with mine, but as you can see in first picture, there’s 2 Green points, one at the minimap, and other on street, when I move there, it should mark where is marked at minimap but…
I’ve made a mini map module which might be helpful, Minimap module - Minimap creator (you could even skim through to see how it works), I’m going to assume you would rather make your own custom minimap, if so, what’s the size of your image(the size of the original image in pixels) and the size of your map (X and Z)?
Instead of doing game.Player.LocalPlayer.Character:WaitForChild("HumanoidRootPart"), each frame, you could create a variable called HumanoidRootPart and update it each time LocalPlayer.CharacterAdded is fired, it should reduce resource consumption.
I don’t exactly know
I don’t kinda want your method, I mean, is lovely… but it’s not exactly what I want, and the map has many parts, so imagine… lol
I just need to know how to set this up to make it go to correct position
local mapFrame = script.Parent.MapFrame.ImageLabel
local MAP_STUD_SIZE = 2404
local centerPos= game.Players.LocalPlayer.Character:WaitForChild('HumanoidRootPart')
centerPos = game.Players.Character:WaitForChild('HumanoidRootPart')
local ORIGIN = script.Value.Value
local diff = centerPos.Position - ORIGIN
local mapSize = script.Parent.MapFrame.ImageLabel.Size.X.Offset
local newSize = math.floor(mapSize + (script.zoom.Value * 1 - mapSize) * 0.02)
mapFrame.Position = UDim2.new(0.5, diff.Z / MAP_STUD_SIZE * newSize, 0.5, -(diff.X / MAP_STUD_SIZE) * newSize)
mapFrame.Size = UDim2.new(0, newSize, 0, newSize)
Since you’re not using scale, you could use 2 offset constants which will be added onto the offset, and as you’re also planning on changing the size of the map(zoom), you might also need to work out a ratio to multiply the offset by when you change the size of of the map, it’s not the most efficient solution in my opinion but, if you’re going for functionality, it should (hopefully) do the trick.