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: How to use CFrame;lerp() ?

Previous Thread :: Next Thread 
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
15 Jul 2015 05:16 PM
I don't understand the "alpha" bit. (I don't originally speak English and thus don't know what this refers to, but I wish to learn everything in English > Long story.)


They have a cave troll
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
15 Jul 2015 05:20 PM
No one knows how to use CFrame:lerp()?


They have a cave troll
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Jul 2015 05:22 PM
the alpha is the percentage between the starting point and the goal (a number 0 to 1)
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
15 Jul 2015 05:23 PM
Didn't it just came out?

Anyways, I think it's like this:


local cframe1=CFrame.new(1,0,0)
local cframe2=CFrame.new(2,0,0)
cframe1:Lerp(cframe2,0.5) --The last parameter is the alpha, 0.5 means in the middle, 1 is I guess all the way.

Please, excuse my explanation.
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
15 Jul 2015 05:28 PM
How could this be applied on a Part? Like I want it to tween to a new position, tis is what I completely failed to do:

workspace.Part.CFrame = CFrame:lerp(workspace.Part.CFrame+Vector3.new(0,10,0),0.1)
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
15 Jul 2015 05:30 PM
Something like this:
for i=1,100 do
part.CFrame=part.CFrame:lerp(part.CFrame+CFrame.new(1,0,0),0.5)
wait()
end
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
15 Jul 2015 05:31 PM
* not +
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
15 Jul 2015 05:34 PM
lerp is not a valid member
00:34:08.012 - Script 'part = workspace.Part for i=1,100 do
part.CFrame=part.CFram', Line 2
00:34:08.013 - Stack End

wat
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
15 Jul 2015 05:37 PM
for i=1,100 do
part.CFrame=part.CFrame:Lerp(part.CFrame*CFrame.new(1,0,0),0.5)
wait()
end

I'm not sure if it's 'Lerp' or 'lerp'
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
15 Jul 2015 05:52 PM
it's :lerp()
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
15 Jul 2015 05:58 PM
local start = Part.CFrame
local end = Part.CFrame * CFrame.Angles(math.rad(90), math.rad(90), math.rad(90)) * CFrame.new(1, 20, 300)
for i = 1, 100, .001 do
Part.CFrame = start:lerp(end, i)
wait()
end

"My Life is going Good... but..."
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
15 Jul 2015 06:06 PM
Pretty sure you are supposed to use Vector3.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
15 Jul 2015 06:08 PM
^
Lerp is Vector3
lerp is CFrame

"My Life is going Good... but..."
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
15 Jul 2015 06:10 PM
You could do this:

local start=part.Position
local end=endpart.Position

for i=0,1,.001 do
wait()
part.Position=part.Position:lerp(end,i)
part.CFrame=CFrame.new(part.CFrame.p,end)
end
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
15 Jul 2015 06:11 PM
Oh, ok. Didnt know that. Not sure about your question then.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
15 Jul 2015 06:15 PM
em, there are a few errors with ur chunk :/
part.Position = part.Position:lerp(end, i)
#1 - 'part.Position' should be 'start'.
#2 - 'lerp' should be 'Lerp'.

P.S. I forgot I wrote the loop wrong, I should have typed,
'for i = 0, 1, .001 do'.

"My Life is going Good... but..."
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
15 Jul 2015 06:22 PM
Sorry about that. I just checked the wiki and found out myself that you use :lerp for cframe and :Lerp for Vector3
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
16 Jul 2015 06:22 AM
well correcting is my job :)

"My Life is going Good... but..."
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
16 Jul 2015 06:29 AM
Lerp is love, lerp is life.
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