Although this question already has a verified answer, I thought I would also give my solution for other users.
Rather than using the head, as demonstrated by adark, you can use the Camera object to get the direction as specified in the question, here's how:
local cameraLookVector = workspace.CurrentCamera.CoordinateFrame.lookVector
game.Players.LocalPlayer.PlayerGui.ScreenGui.Minimap.Rotation = math.deg(math.atan2(cameraLookVector.Y, cameraLookVector.X))
This will now make the Minimap rotate with the Camera, rather than just the Head while only needed one variable as oppose to 12! You may need to add -180 to 180 degrees onto this angle to properly orientate the Minimap.
1 comment
Fantastic, thanks a lot adark.