I’m looking to create a Compass Gui similar to that of *Skyrim* in which Landmarks are visible.

Currently I have a working GUI that simply indicates N, E, S, W etc. However I’m struggling to get it to figure how to get it working with Landmarks / Locations?

I’ve read other forum posts about this however I cannot figure how to implement it.

This is an example of what I’m looking to achieve.

```
local smoothness = 50/3
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local dev = script.Parent
local lastY = 0
local units = {
[dev.N ] = -math.pi * 4/4;
[dev.NE] = -math.pi * 3/4;
[dev.E ] = -math.pi * 2/4;
[dev.SE] = -math.pi * 1/4;
[dev.S ] = math.pi * 0/4;
[dev.SW] = math.pi * 1/4;
[dev.W ] = math.pi * 2/4;
[dev.NW] = math.pi * 3/4;
}
function restrictAngle(angle)
if angle < -math.pi then
return angle + math.pi*2
elseif angle > math.pi then
return angle - math.pi*2
else
return angle
end
end
game:GetService('RunService').PreRender:Connect(function(dt, ...)
local look = camera.CoordinateFrame.lookVector
local look = Vector3.new(look.x, 0, look.z).Unit
local lookY = math.atan2(look.z, look.x)
local difY = restrictAngle(lookY - lastY)
lookY = restrictAngle(lastY + difY* 1 / 30 *smoothness)
lastY = lookY
for unit, rot in pairs(units) do
rot = restrictAngle(lookY - rot)
if math.sin(rot) > 0 then
local cosRot = math.cos(rot)
local cosRot2 = cosRot*cosRot
unit.Visible = true
unit.Position = UDim2.new(0.5 + cosRot*0.6, unit.Position.X.Offset, 0.5, 0)
else
unit.Visible = false
end
end
end)
```