Quest-like UI Movement Behavior

--!strict
local character: Model = script.Parent
local characterHead = character:FindFirstChild("Head") :: Part

local distance = 6

local hudpart = Instance.new("Part")
hudpart.Position = (head.CFrame.LookVector*Vector3.new(1,0,1)).unit * distance + characterHead.Position
hudpart.CanCollide = false
hudpart.CanTouch = false
hudpart.Parent = characterHead
hudpart.CFrame = CFrame.lookAt(hudpart.Position,head.Position)
hudpart.Orientation *= Vector3.new(0,1,0)

local weld = Instance.new("WeldConstraint")
weld.Part1 = hudpart
weld.Part0 = characterHead
weld.Parent = hudpart

local hudAttachment = Instance.new("Attachment", hudpart)

local hud = game.ReplicatedStorage.hud:Clone()
hud.AlignPosition.Attachment1 = hudAttachment
hud.AlignOrientation.Attachment1 = hudAttachment
hud.Parent = character
1 Like

by using this, it should work no matter where you start because instead of positioning it at certain position, this puts it infront of your head (and rotates it towards your head)