#Which way is more performant?

1 messages · Page 1 of 1 (latest)

cedar lotus
#
local part = script.Parent
local partspeed = 0.05 

while task.wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,partspeed,0) 
end
#

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()
stray pulsar
#

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