Rendering a map with Surface GUIs

Hello, I’m struggling with properly rendering a map.

This is my code:

local RadarObj = ObjectT[Object]
RadarObj.ZIndex = Object.Position.Y * Multiplier
local Offset = Vector3.new(Object.CFrame.Position.X, 1, Object.CFrame.Position.Z)
local Rotation = Object.CFrame
local X1,Y1,Z1 = Rotation:ToOrientation()
local DegreeY = math.deg(Y1)
RadarObj.Rotation = -DegreeY
RadarObj.Position = UDim2.new((Object.CFrame.Position.X * SCALE_FACTOR) + 0.5, 0, (Object.CFrame.Position.Z * SCALE_FACTOR) + 0.5, 0)				
RadarObj.Size = UDim2.new(X * SCALE_FACTOR, 0, Y * SCALE_FACTOR,0)
RadarObj.BackgroundColor3 = Object.BrickColor.Color

The RadarObj, which is a textlabel, has an anchor point of (0.5, 0.5)

As you can see in this image, when the two parts are aligned, they are aligned in the Surface GUI

But when it is rotated, they become out of sync, like this

The scale factor is 1/600

I have a feeling it is something to do with my offset or rotation but I don’t know and need some help.

Did u anchored the part???plus,use math.rad.math.deg can work but i need to see what code to use

I have to check your position.(it looks wrong as UDIM2.new(offestx,x,offsety,y)

You are only changing the offset.try changing the coordinates ans see if it works

Found an easier way, just used a viewportframe instead.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.