Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
|
| 11 Apr 2015 04:37 PM |
How do I use this script?
http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700
|
|
|
| Report Abuse |
|
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 11 Apr 2015 05:41 PM |
Just like lerp(), you give the function 2 CFrame values (this includes rotation). However, instead of returning a new value based on a number from 0 to 1, it returns two values: an angle difference ("theta") and another function which you use to get the new CFrame.
To use it like lerp(), you can ignore the first value (use an underscore) and simply use the second value. It would look like this:
local _,anim = StravantsFunctionHere(FirstCFrame, SecondCFrame)
Then, to get a CFrame between them, you'd call the "anim" function you just got:
anim(.5) -- CFrame halfway through anim(.75) -- CFrame three quarters of the way through |
|
|
| Report Abuse |
|
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
| |
|
|
| 11 Apr 2015 05:48 PM |
local clerp = require( workspace.CFrameInterpolation ) -- Indicating that the Module i's in the workspace, and called "CFrameInterpolation"
The module returns w/ 2 arguments, the theta ( a number ), and the lerp ( a function ).
For example:
local _, cframe = clerp(CFrame.new(), CFrame.new(0,10,0))
The "_" variable is the theta of the given function, the "cframe" variable returns w/ the Lerped CFrame values w/ the given alpha ( the "cframe" function's argument )
Lets say you want to make the cframe to lerp in 10 frames every second, you do:
local Frames = 10
for i = 0, Frames do local newCFrame = cframe( i/Frames ) -- ( i/Frames ) is the alpha print( newCFrame ) wait(1/33) end
Lets say you want the half of the "cframe" function's Coordinates.
You simply do:
local newCFrame = cframe( .5 ) print( newCFrame )
Stravant's Module works just like the Vector3:Lerp() function on Roblox, just that Stravant's is used for CFrame. |
|
|
| Report Abuse |
|
|
Moeru
|
  |
| Joined: 25 Mar 2015 |
| Total Posts: 396 |
|
|
| 11 Apr 2015 05:56 PM |
The confusion is real...
I have no idea how to use ModuleScripts. |
|
|
| Report Abuse |
|
|
|
| 11 Apr 2015 05:59 PM |
You call module scripts by using the "require" method.
http://wiki.roblox.com/index.php?title=API:Class/ModuleScript http://wiki.roblox.com/index.php?title=Function_dump/Functions_specific_to_ROBLOX#require |
|
|
| Report Abuse |
|
|