Hi. I have a UI which I want to follow the character’s humanoidrootpart, however, it does not seem to be doing what I intended for it.
https://gyazo.com/db08d4b1deab4b5ba4e0955599826aff
While it still moves, it is not following the character for some reason. Here is my code:
self.infoPanelUpdate = coroutine.create(
function()
while true do
RunService.RenderStepped:Wait()
local character = self.Player.Character
if not character or not character.HumanoidRootPart then return end
local screenPosition = currentCamera:WorldToScreenPoint(character.HumanoidRootPart.Position)
local newPosition = UDim2.new(0, screenPosition.X, 0, screenPosition.Y)
infoPanel.Position = newPosition
end
end
)
coroutine.resume(self.infoPanelUpdate)