#Which way is more performant?
1 messages · Page 1 of 1 (latest)
or
local TweenService = game:GetService("TweenService")
local part = script.Parent
local Info = TweenInfo.New(
1,
enum.EasingStyle.Sine,
enum.EasingDirection.Out,
math.Huge
false,
0
)
local Goal = {
CFrame = part.CFrame * CFrame.Angles(0, math.rad(90), 0)
}
local Tween = TweenService:Create(part, Info, Goal)
Tween:Play()
tweenservice and setting the cframe is essentially the same thing
but because tweenservice runs on Roblox side it has more opportunity to be optimized better but i have not benchmarked
also you should not use math.Huge for the tweeninfo
if you set repeat count to -1 then it will loop indefinitely
HingeConstraint would have the best performance https://create.roblox.com/docs/reference/engine/classes/HingeConstraint