Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I use CFrame lerp?

I really cant understand it, but it would be extremely helpful in my game.

1 answer

✓ Accepted answer

Say you want to interpolate one brick between two orientations (position and rotation), you would use the new CFrame linear interpolation method.

local CFrame1=CFrame.new()
local CFrame2=CFrame.new(Vector3.new(10,10,10),Vector3.new())
for i=0,1,.01 do
	Part.CFrame=CFrame1:lerp(CFrame2,i)
	wait()
end

This will make the Part transition from the first CFrame to the second, in the same way that animations are interpolated. The same thing could be done for camera transitions as well.

2 comments

0

How would this be used in a model?

2

Sorry for late comment but you could do local CFrameM = workspace.(Model Name).PrimaryPart.CFrame:Lerp(CFrame1, i)

This discussion is preserved as it was. New answers, comments, and votes are closed.