Juddily
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 4243 |
|
|
| 30 Jul 2014 01:08 PM |
I'm trying to make a tweening function, and it worked for a while, until I added the dreaded ROTATION MATRIX. Basically, I divided each component of the CFrame by the amount of total Frames, or positions, or --whatever; How many times the part is moved in total. I would get all 12 components of a CFrame, and divide them each by 12. This worked just fine when I tested it with just the first three values (X,Y,Z), but as soon as I added the other 9 values of the rotation matrix, it broke. Does anybody know how to divide a CFrame successfully? Here's what I had, that didn't work: function Tween(Part, CF, Time) local Frames = 30 * Time local CF2 = CF * Part.CFrame:inverse() a,b,c,d,e,f,g,h,i,j,k,l = CF2:components() a,b,c,d,e,f,g,h,i,j,k,l = a/Frames,b/Frames,c/Frames,d/Frames,e/Frames,f/Frames,g/Frames,h/Frames,i/Frames,j/Frames,k/Frames,l/Frames local CFrame3 = CFrame.new(a,b,c,d,e,f,g,h,i,j,k,l) for i = 1, Frames do Part.CFrame = Part.CFrame * CFrame3 wait(.1) end end
wait(1)
Tween(Workspace.Part, Workspace.Part2.CFrame, 5) |
|
|
| Report Abuse |
|
Juddily
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 4243 |
|
|
| 30 Jul 2014 01:11 PM |
Actually, I think it might have something to do with the method I'm using to 'subtract' the CFrames from eachother. local CF2 = CF * Part.CFrame:inverse() Is this correct? |
|
|
| Report Abuse |
|