Degree Issue with Tweening: Doesn't Spin my Model 360° even though Its coded to

So I could be doing something completely wrong but I’m trying to get ‘Rings’ to tween in a 360° circle. However when testing it, it seems to only rotate 340° or 350° before snapping back to 0°. I tried 0,0,0 on all possible Orientation/Pivot info tabs both in CFrame and Origin on the parent. Still doesn’t work. Any ideas anyone?

Code:

local Rings = script.Parent.ThreeRings.Three -- Three is the part I want spinning.

local TweenService = game:GetService("TweenService")
local ThreeSpinTweenBase = TweenInfo.new(3,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut,-1,false,0)

local ThreeSpinTweenConfig = TweenService:Create(Rings, ThreeSpinTweenBase, {
	
	CFrame = Rings.CFrame * CFrame.Angles(0, 0, 360) -- Says it goes 360°
	
})

ThreeSpinTweenConfig:Play()

I’m still an armature to coding so I could be using the wrong formula. Below is a more detailed explanation as to what I want done just in case the first block of text was too vague.

So the current part I want to rotate 360° has 3 children welded to its parent. Parent being called “Rings” and the 3 children being “Part” respectively. The code above is supposed to take the “Rings” and rotate it over a 5 second tween in a 360° circle. However before it completes the circle it gets about 90% through the 360° before abruptly snapping back to its starting position. I tried looking and changing all the Rotation/Orientation/Pivot etc. Information to (0, 0, 0) just in case of hidden data messing it up. I tried different coding methods such CFrame.fromEulerAnglesXYZ. Still no avail, could anyone give a peak and help a dude out?

All replies are appreciated :smiley: Thank you so much! Feel free to ask all the questions needed; I’ll provide the information.

make three different tweens and for each of the tween use 120 degrees instead, This wouldn’t work because 360 degrees will go back to 360 degrees (original rotation) thus it does not rotate

1 Like

I’m pretty sure the reason it doesn’t work is because it’s not 360 degrees like you want, it’s 360 radians. to convert degrees to radians, use math.rad. so the line should look like this:

CFrame = Rings.CFrame * CFrame.Angles(0, 0, math.rad(360))
1 Like

Thank you so much!! This worked! Only slight change, as to what ifqiyeh mentioned prior, changing it to 120° instead of 360° makes it rotate correctly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.