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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: smooth cframe tweening?

Previous Thread :: Next Thread 
sevricksalt1 is not online. sevricksalt1
Joined: 10 Jan 2015
Total Posts: 204
26 Sep 2015 10:28 PM
i hate the hackish movement.
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
26 Sep 2015 10:29 PM
linear interpolation

http://wiki.roblox.com/index.php?title=Lerp
Report Abuse
sevricksalt1 is not online. sevricksalt1
Joined: 10 Jan 2015
Total Posts: 204
26 Sep 2015 10:31 PM
explain, roblox does it horribly
Report Abuse
darkstriken is not online. darkstriken
Joined: 23 Oct 2010
Total Posts: 376
26 Sep 2015 10:32 PM
I made this earlier.

local Interpolate = function(CFrame, EndCFrame, Time, Asynchronous)
local UseRender
local Time = Time/100
if Time < 0.3 then
UseRender = true
end
local function Finish()
for i = 1, 100 do
CFrame = CFrame:lerp(EndCFrame, i/100)
if UseRender and script:IsA("LocalScript") then
game:GetService("RunService").RenderStepped:wait()
else
wait(Time)
end
end
end
if Asynchronous then
coroutine.resume(coroutine.create(Finish))
else
Finish()
end
end
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
26 Sep 2015 10:34 PM
"CFrame.lerp — uses quaternion slerp to interpolate orientations, and linear interpolation to interpolate positions."

CFrame:lerp(CFrame goal, number alpha)

So let's say we have a part;

local fullTime = 1 -- time to interpolate in total
for i = 1, 20 do
part.Position = part.CFrame:lerp(new goal, 1/20)
wait(fullTime / 20)
end

new goal should be the final goal as a CFrame.
number alpha is a decimal from 0 to 1 that indicates how far to move on that specific step
Report Abuse
sevricksalt1 is not online. sevricksalt1
Joined: 10 Jan 2015
Total Posts: 204
26 Sep 2015 10:34 PM
nvm i get it know, its like camera interpolation
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
26 Sep 2015 10:35 PM
it isn't really.
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