Motor6D going to seemingly random numbers when changing orientation through a script

I wanted to animate some wings for a star glitcher model by tweening the C1s but setting the orientation always ended up with a strange and huge number, even with decimals

(dont mind the ugly ui it has different colours in game)

local TweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true, 0)

local Wing1 = TweenService:Create(script.Parent.ring1.Wing, tweenInfo, {C1 = CFrame.new(0, .125, 0) * CFrame.Angles(0, 2.5, 2.5)}):Play()
local Wing2 = TweenService:Create(script.Parent.ring1.Wing1.Wing, tweenInfo, {C1 = CFrame.new(0, .25, 0) * CFrame.Angles(0, 5, 5)}):Play()
local Wing3 = TweenService:Create(script.Parent.ring1.Wing2.Wing, tweenInfo, {C1 = CFrame.new(0, .5, 0) * CFrame.Angles(0, 10, 10)}):Play()

CFrame.Angles() takes in radiants instead of degrees, in which a full 360 turn is 3.14… aka 2 pi
Try using math.rad() to convert them to radiants like so

local Wing1 = TweenService:Create(script.Parent.ring1.Wing, tweenInfo, {C1 = CFrame.new(0, .125, 0) * CFrame.Angles(0, math.rad(2.5), math.rad(2.5))}):Play()
local Wing2 = TweenService:Create(script.Parent.ring1.Wing1.Wing, tweenInfo, {C1 = CFrame.new(0, .25, 0) * CFrame.Angles(0, math.rad(5), math.rad(5))}):Play()
local Wing3 = TweenService:Create(script.Parent.ring1.Wing2.Wing, tweenInfo, {C1 = CFrame.new(0, .5, 0) * CFrame.Angles(0, math.rad(10), math.rad(10))}):Play()

Edit: oh whoops accidentally wrapped the stuff in CFrame.new too

2 Likes

if @Cliosow’s solution doesnt work as intended try wraping the values in CFrame.new in a Vector3.new
CFrame.new(Vector3.new(0, .125, 0))
CFrame.new(Vector3.new(0, .25, 0))
CFrame.new(Vector3.new(0, .5, 0))

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