I am attempting to make a simple lagless pet system and am using motor6ds since I would like to be able to animate the pets in the future. However, when I attempt to use the transform property my pet models dont change at all and they are all placed in the middle of my players humanoidrootpart. V is the pet model.
local function addPet(player, petId)
local function GetPointOnCircle(Degrees, CircleRadius)
return Vector3.new(math.cos(math.rad(Degrees)) * CircleRadius, 0, math.sin(math.rad(Degrees)) * CircleRadius)
end
local v = workspace.ClientPets[petId]
local i = table.find(iTable[player.UserId], petId)
local newPosition = (player.Character.HumanoidRootPart.CFrame * CFrame.new(GetPointOnCircle(5, 360/player.SessionStats.PetsEquipped.Value * i))).Position - Vector3.new(0, player.Character.HumanoidRootPart.Size.Y / 2, 0)
local Motor6D = Instance.new("Motor6D")
Motor6D.Parent = player.Character.HumanoidRootPart
Motor6D.Part0 = player.Character.HumanoidRootPart
Motor6D.Part1 = v.HumanoidPart
Motor6D.Transform = CFrame.new(newPosition)
end