local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer if not player then return end local character = player.Character or player.CharacterAdded:Wait() local HumanoidRootPart = character:WaitForChild("HumanoidRootPart") local function createAxis(name, color, size, orientation, meshOffset) local part = Instance.new("Part") part.Name = name part.Size = size part.Anchored = false part.CanCollide = false part.Massless = true part.Color = color part.Material = Enum.Material.Plastic part.TopSurface = Enum.SurfaceType.Smooth part.BottomSurface = Enum.SurfaceType.Smooth part.Transparency = 0 part.Orientation = orientation part.Position = Vector3.new(0, 0, 0) local mesh = Instance.new("SpecialMesh") mesh.Name = "Mesh" mesh.MeshType = Enum.MeshType.Cylinder mesh.Offset = meshOffset mesh.Scale = Vector3.new(1, 1, 1) mesh.VertexColor = Vector3.new(1, 1, 1) mesh.Parent = part return part end local COMModel = Instance.new("Folder") COMModel.Name = "CenterOfMass" COMModel.Parent = HumanoidRootPart local XAxis = createAxis("XAxis", Color3.fromRGB(255, 0, 0), Vector3.new(4, 0.5, 0.5), Vector3.new(0, 0, 0), Vector3.new(0, -0.424, 0)) XAxis.Parent = COMModel local YAxis = createAxis("YAxis", Color3.fromRGB(0, 255, 0), Vector3.new(4, 0.5, 0.5), Vector3.new(0, 0, 90), Vector3.new(-0.424, 0, 0)) YAxis.Parent = COMModel local ZAxis = createAxis("ZAxis", Color3.fromRGB(0, 0, 255), Vector3.new(4, 0.5, 0.5), Vector3.new(0, 90, 0), Vector3.new(0, -0.424, 0)) ZAxis.Parent = COMModel for _, part in ipairs(COMModel:GetChildren()) do if part:IsA("BasePart") then part.CFrame = HumanoidRootPart.CFrame * (part.CFrame - part.Position) local weld = Instance.new("WeldConstraint") weld.Part0 = HumanoidRootPart weld.Part1 = part weld.Parent = HumanoidRootPart end end local rootWeldPart = XAxis RunService.Heartbeat:Connect(function() if not rootWeldPart then return end local relativeCOM = rootWeldPart.CFrame:PointToObjectSpace(rootWeldPart.AssemblyCenterOfMass) XAxis.Mesh.Offset = relativeCOM YAxis.Mesh.Offset = Vector3.new(relativeCOM.Y, -relativeCOM.X, relativeCOM.Z) ZAxis.Mesh.Offset = Vector3.new(-relativeCOM.Z, relativeCOM.Y, relativeCOM.X) end)