Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[ ADVANCED ] GUI arrow won't follow a part in workspace?

Asked by
14dark14 167
2 years ago
Edited 2 years ago

Hello, my goal is self-explanatory, have a Ui arrow point in the direction of a part that is in the workspace.

The issue is that I cannot figure out how to make the Ui arrow move freely on the Frame, it sticks to the side of the Frame, making it look "janky" by constantly teleporting around the Frame from side to side.

Here is a video example of what I am trying to achieve and what I have so far.

imgur.com/a/MmHyoe4 https://imgur.com/a/MmHyoe4

And here is the LocalScript which makes my version work like it does.

001local Markers = {}
002local Screen = script.Parent.Holder.AbsoluteSize
003local T = game:GetService("TweenService")
004 
005for i,v in pairs(game.ReplicatedStorage.Markers:GetChildren()) do
006    local Marker = script.Sample:Clone()
007    Marker.Parent = script.Parent.Holder
008    Marker.ImageColor3 = v.Config.MarkerColor.Value
009    Marker.RotateLabel.Arrow.ImageColor3 = v.Config.MarkerColor.Value
010    Marker.Icon.Image = v.Config.Icon.Value
011    table.insert(Markers,{Marker,v})
012end
013 
014function ClampMarkerToBorder(X,Y,Absolute)
015    X = Screen.X - X
View all 100 lines...

Answer this question