How to create an objective locator?

That is how you want it? Your previous image shows how you are describing it to me…

Maybe tell me the game and I can take a look.

Flood Escape 2 is the name of the game.


The lines that you want are like this, correct?

Yes, I want it like that, minus the yellow line.

Usually we aren’t just supposed to give out scripts in this topic. But I’ll try.

local RS = game:GetService("RunService")

local camera = workspace.CurrentCamera

local gui = -- whereever your gui is (frame)

local pointA = --
local pointB = --

RS.RenderStepped:Connect(function()
        local screenPointA = UDim.fromOffset(camera:WorldToScreenPoint(pointA.Position))
        local screenPointB = UDim.fromOffset(camera:WorldToScreenPoint(pointB.Position))

        gui.Position = screenPointA:Lerp(screenPointB, 0.5)

        local diff = screenPointB - screenPointA
        gui.Rotation = math.atan2(diff.Y, diff.X)
end)

I didn’t test this code, make sure you fill in the variables at the top, and make sure the frame is really long, flat and thin.

Players.TehEpikNoobKing.PlayerGui.ScreenGui.Frame.LocalScript:12: attempt to call a nil value - Client - LocalScript:12
Stack Begin - Studio
Script ‘Players.TehEpikNoobKing.PlayerGui.ScreenGui.Frame.LocalScript’, Line 12

You can use @Den_vers code and see if that works for you. An alternative option would be to use Buildboard UIs and manipulate their size and position.

I think I forgot UDim2, change it to that, and can you please fix the obvious bugs?

Thank you for the base of the script, I will update it accordingly, thank you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.