Setting a GUIs position to the position of a part on the players screen

I want a GUI to be moved around based off of where a part is on the players screen but Im very confused on how I could go about doing it

So far Ive managed to get the position using WorldToViewportPoint() but it doesnt “translate” well and instead of the GUI going where the part is, it goes to that position on the screen, kind of hard to explain

Here is the lines of code that im currently using for this:

			while true do
				task.wait();
				local worldPoint = game.Workspace.Part.Position;
				local vector, inViewport = Cam:WorldToViewportPoint(worldPoint);
				local viewportPoint = UDim2.new(vector.x, vector.y);
				GUI.Frame.Test.Position = viewportPoint;
			end

Would a BillboardGui not suit your requirements better?

1 Like