概要
代码示例
手动定位帽子
local hat = script.Parent
local character = hat.Parent
-- 将帽子的 CFrame 设置为角色头部的 CFrame
hat.Handle.CFrame = character.Head.CFrame * CFrame.new(0, character.Head.Size.Y / 2, 0) * hat.AttachmentPoint:inverse()local hat = script.Parent
local character = hat.Parent
-- 将帽子的 CFrame 设置为角色头部的 CFrame
hat.Handle.CFrame = character.Head.CFrame * CFrame.new(0, character.Head.Size.Y / 2, 0) * hat.AttachmentPoint:inverse()