I’m currently using TweenService to linearly tween an object’s CFrame to the character’s CFrame, but the tweening of the orientation is very slow over long distances. This is because the time is dependent on the distance between the pet and the player to ensure that the pet is moving at a linear speed. However, this also means that the object’s orientation will move slowly if the distance is long (since the time to tween the orientation is increased over extended periods of time). Does anyone have any recommendations? I attempted to tween the part’s orientation, but this does not work as the part is welded and welds are ignored while an orientation is adjusted.
(petObj is the pet object and rootpart is the humanoid root part)
game:GetService("RunService").RenderStepped:Connect(function(dt)
local Distance = (RootPart.Position - petObj.Position).Magnitude
local Info = TweenInfo.new(Distance / 7)
local NewCFrame = CFrame.lookAt(RootPart.Position, petObj.Position)
local Tween = TweenService:Create(petObj, Info, {CFrame = NewCFrame})
Tween:Play()
end)