|
| 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 |
|
|
|
| 15 Jul 2015 05:20 PM |
No one knows how to use CFrame:lerp()?
They have a cave troll |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 15 Jul 2015 06:06 PM |
| Pretty sure you are supposed to use Vector3. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2015 06:08 PM |
^ Lerp is Vector3 lerp is CFrame
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 15 Jul 2015 06:11 PM |
| Oh, ok. Didnt know that. Not sure about your question then. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 16 Jul 2015 06:22 AM |
well correcting is my job :)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 06:29 AM |
| Lerp is love, lerp is life. |
|
|
| Report Abuse |
|
|