How to make a secret finding compass

My issues :
Hello I am currently trying to make a compass for my game which will guide’s players to secret location. But I don’t know how should i do it. Is this even possible?

Image :

The image above shows what I am trying to achieve. There is barely any solutions on youtube to I have to count on you guys. Please help me !

Are you hoping for a GUI to point to a world position?

Not I want they compass hand to show where they are.

are you trying to do this :

or this ?

You can CFrame the compass needle to face the direction of the location.

Here’s a very simple proof of concept:

local Needle = workspace.Needle
local Target = workspace.Target

while wait() do
	Needle.CFrame = CFrame.new(Needle.Position, Vector3.new(Target.Position.X, 0, Target.Position.Z))
end

https://gyazo.com/ecadb0b160d7cfc847e1564f0ac16c2d

2 Likes

Use this code as a reference

compass.CFrame = CFrame.new(compass.CFrame.p,pos2)

1 Like

The 2nd one I want. I want compass point towards it.

Is there any other way to do this without while loop?

I will surely look onto that. Thanks.

Not that I can think of. You can make it more efficient by only running when the player has the compass out and/or increasing the wait time.

or using a while true do loop and calling wait(n) after that instead.

2 Likes

Alright thank you guys for reply. I will try to make it much more efficient with the sources you guys provided.

How did you make the part not move around