This script is broken

Hey guys. I’m having an issue. I’m trying to Tween this part’s rotation, but it’s like the rotation is limited. For instance, if I say
Goal.CFrame = Part.CFrame * CFrame.new(1, 0, 0) * CFrame.Angles(0, 100000, 0), it won’t actually rotate 100k studs, and will instead rotate about 10 studs or so. Is there a way to fix this?

1 Like

The problem is I’m pretty sure roblox has a limit to how much rotation can be done in a single Tween without doing multiple Tweens. I’m not 100% sure though

Okay, but how do I work around that?

Indeed, Roblox does have a limit on how much rotation can be done in a single Tween. To work around this limitation, you can break down your desired rotation into smaller steps and apply multiple Tweens consecutively. Here’s a basic example of how you can do this:

local Part = ... -- Your part here
local totalRotation = 100000 -- Total rotation in degrees
local stepRotation = 45 -- Rotation per step (adjust as needed)
local duration = 0.5 -- Duration for each Tween (adjust as needed)

for i = 1, totalRotation / stepRotation do
    local rotationStep = CFrame.Angles(0, math.rad(stepRotation), 0)
    local currentRotation = Part.CFrame * rotationStep
    local goalRotation = currentRotation * CFrame.new(1, 0, 0)

    local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)

    local tween = game:GetService("TweenService"):Create(Part, tweenInfo, {
        CFrame = goalRotation
    })

    tween:Play()
    tween.Completed:Wait() -- Wait for the Tween to complete before moving to the next step
end

In this example, we’re breaking down the 100,000-degree rotation into smaller 45-degree steps and using a Tween for each step. You can adjust the stepRotation and duration values to suit your needs. This way, you can achieve the desired rotation by chaining multiple Tweens together.

1 Like

Sorry for late reply. I’ll test this and get back with you soon! Thanks!

Can you explain what you mean by rotating 100k studs? CFrame.Angles(0,100000,0) is tellin the part to rotate 100000 radians.