Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Which of these two ways to rotate a model is the best way to rotate a model consistently?

Asked by 3 years ago
Edited 3 years ago

I have 2 different ways that work pretty well. I'd like to know which is better, or if there is another that would be better than my current two... And why.

The first one I have used just takes rotates the model by using a while true do loop to set the CFrame

while true do
    wait(0.25)
    model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, math.rad(90), 0))
end

The second on uses a tween

local Info = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.In, -1)
local tween = TweenService:Create(DummyValue, Info, {Value = cframe})
tween:Play()

They both do the same thing; I would just like to know which would be "better", I guess which would be more efficient than the other? If any lol. Thanks

1 answer

Log in to vote
0
Answered by
Speedmask 661 Moderation Voter
3 years ago
Edited 3 years ago

I suppose they are both okay, but TweenService is made for transitions and you will have more control over your rotation, not to mention that it's more intuitive. however, I'll do you one better, what if I said that there's a third option that might be even better than both?

Torque.

0
You absolutely rock! Thank you! yoman7777 17 — 3y
Ad

Answer this question