generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

CFrame woes

Previous Thread :: Next Thread 
Juddily is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image