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

I have a question about lerp, what does fraction alpha mean?

local Track = workspace:FindFirstChild(instance).CFrame:Lerp(CloseDoor,0.1)

The fraction alpha is the "0.1" at the end. I never really understood people put i there in a for i loop. What does fraction alpha mean?

1 answer

✓ Accepted answer

Alpha is the how far it is in reaching its goal, in percentage.

So Track is a CFrame that is 10% to its goal, CloseDoor.

In for loop (not for i loops), they'll go from 0 to 1 in increments of 0.1 for example, since 1 is 100%, where 0 is 0%, 0.5 is 50%, ect.

Example code;

local cf, goal = CFrame.new(25, 25, 25), CFrame.new(50, 50, 50);

for i = 0, 1, 0.1 do
	print(cf:Lerp(goal, i));
end

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