Angle tween not working correctly?
I've used crazyman32's CFrame Tween and edited it so it works slightly correctly.
My problem is that on line 2, if I don't add rs_Joint[3]*
then it moves the part to the center of the character, but if I do, I can only tween it from a 0,0,0 angle, otherwise it screws up. I need it to tween from any angle to that one, though I can't figure out what to do
F.Y.I. I'm not very fond of CFrame...even though I've been using Lua for over 4 years..
01 | coroutine.wrap( function () |
02 | local NewCF = rs_Joint [ 3 ] *CFrame.Angles(math.rad( 30 ), 0 , 0 ) |
03 | local oldangle = Vector 3. new(rs_Joint [ 3 ] :toEulerAnglesXYZ()) |
05 | local newangle = Vector 3. new(NewCF:toEulerAnglesXYZ()) |
08 | rs_Joint [ 3 ] = CFrame.new((oldpos*( 1 -i))+(newpos*i))*CFrame.fromEulerAnglesXYZ((oldangle.x*( 1 -i))+(newangle.x*i),(oldangle.y*( 1 -i))+(newangle.y*i),(oldangle.z*( 1 -i))+(newangle.z*i)) |