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 » Scripters
Home Search
 

Re: is there a way to make the CFrame 'tween'

Previous Thread :: Next Thread 
puma246810 is not online. puma246810
Joined: 27 Aug 2011
Total Posts: 9
08 Jul 2015 10:37 AM
local x = 1

game:GetService'RunService'.RenderStepped:connect(function()
for i = 1,#Tablets do
Tablets[i].CFrame = Character.Torso.CFrame*CFrame.Angles(0,math.rad(360/#Tablets*x),0)*CFrame.new(0,0,-2*#Tablets)
end
end)
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
08 Jul 2015 10:45 AM
Interpolating CFrames?

http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
08 Jul 2015 10:48 AM
Yes, but it's a little involved. Stravant et al. made an axis-angle interpolation that's a good tradeoff between speed and accuracy: http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700

If for some reason you need to be more accurate than that (it really isn't noticeably inaccurate in most cases) he also has an accurate function for quaternion interpolation that's about 4x slower, which I only half understand: http://wiki.roblox.com/index.php?title=User:XLEGOx/quaternioninterpolate

~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
08 Jul 2015 10:52 AM
CFrame:lerp(CFrame goal, Alpha)
StartingPoint:lerp(EndPoint, Percentage (0 - 1))

So apply it in a loop, and slowly change it from 0 to 1.
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
08 Jul 2015 10:53 AM
Yeah... So I didn't know they added that method and I'm super stoked right now. When was it added?

~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
08 Jul 2015 10:55 AM
It was added a few days ago, TheGamer101 made it; I only know due to RBXDev.
They don't update the public like they used to anymore.

"New feature: CFrame:lerp() 1 day 21 hours ago" 2 days ago.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
08 Jul 2015 11:02 AM
YUSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
08 Jul 2015 11:03 AM
I think I applied to that once but to no avail because I guess technically I haven't made a complete game lol. Thanks for the info.

~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~
Report Abuse
puma246810 is not online. puma246810
Joined: 27 Aug 2011
Total Posts: 9
08 Jul 2015 11:10 AM
how come this isn't working?

Tablets[i].CFrame = Tablets[i].CFrame:lerp(Character.Torso.CFrame*CFrame.Angles(0,math.rad(360/#Tablets*x),0)*CFrame.new(0,0,-2*#Tablets),i);
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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