How to make my compass show direction to the part?

Hi,
So i have a compass and i want its arrow show the way to a part. I tryed many ways and stopped at
But this script always shows to the front of the part, but i want it to show to a part. how to make it show to a part?

while true do
    local RotTo = workspace:FindFirstChild("Part")
    script.Parent.Arrow.Orientation = RotTo.Orientation
    wait()
end

I am unsure for what you are asking. Do you want the compass arrow to point to the RotTo part, or to have the same rotation as the RotTo part?
Also, side note, using wait() in a while true loop is bad for these reasons: Avoiding wait() and why

i want compass arrow show to point to the rotTo

You can change the CFrame of the arrow part.

Try:
script.Parent.Arrow.CFrame = CFrame.new(script.Parent.Arrow.Position, RotTo.Position)

You should read this article on CFrames.

i tryed this but problem is player cant move

vid: https://gyazo.com/54854462133d35a7108f5cc22d30901c

So I did some experimenting and this is what I came up with:

In a LocalScript within a tool:

local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.FrontSurface = Enum.SurfaceType.Hinge
part.Parent = workspace.CurrentCamera

script.Parent.Handle.Transparency = 1

local runService = game:GetService("RunService")

while true do
	runService.RenderStepped:Wait()
	part.CFrame = CFrame.new(script.Parent.Handle.Position, workspace.lookAtMe.Position)
end

What I found is that the arrow part cannot be in the tool object, and it has to be anchored with collisions off. In order for it to work smoothly, you have to use RunService.RenderStepped:Wait(), and not wait()

1 Like

what is the part you created at the top? nvm this is arrow i see

It is the arrow part, sorry I didn’t explain that. It cannot be in the tool or else it will glitch the player like what happened before. Mine is very rudimentary with just basic parts, you would have to apply this system to however your tool is made up (arrowPart, handle)