I'm trying to generate a minimap GUI for a map, but my script isn't working (and I'm not sure why). All of the walls in my map are in one model, so the script creates a frame for each wall, sizes it, and places it where it should go on the minimap.
for i,v in pairs(game.Workspace.Map1.Walls:GetChildren()) do local frame = game.StarterGui.WallFrame:Clone() frame.Parent = game.StarterGui.ScreenGui.MinimapFrame local xSize = v.Size.X local zSize = v.Size.Z local xPos = v.Position.X local zPos = v.Position.Z local rot = v.Rotation.Y d = 2 frame.Size = UDim2.new(0, xSize/2, 0, zSize) frame.Position = UDim2.new(0, xPos/d + 100 - xSize/2, 0, zPos/d + 100 - zSize) frame.Rotation = rot end
For whatever reason this is what is coming up: http://i.imgur.com/MvfKG5c.png And this is not quite what the map looks like (the problem seems to be mostly with the big walls, but I'd like to get the rest of the walls looking like they should).