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.