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: Stravant's CFrame interpolation module

Previous Thread :: Next Thread 
Moeru is not online. 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 is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 04:46 PM
bump
Report Abuse
Moeru is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 05:05 PM
bump2
Report Abuse
Moeru is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 05:17 PM
bump3
Report Abuse
Moeru is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 05:32 PM
bump4

please help
Report Abuse
Moeru is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 05:39 PM
bump5

:/
Report Abuse
NotAshley is not online. 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 is not online. Moeru
Joined: 25 Mar 2015
Total Posts: 396
11 Apr 2015 05:43 PM
@NotAshley Thanks C:
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
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 is not online. 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
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
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
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