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

How do I get the mid position of two different positions?

1 answer

✓ Accepted answer

I'm pretty sure there's an API for this called lerping or something weird. You should probably do it with the API if you can because that's written in C rather than Lua.

function interpolate (a, b, amount)
    -- amount is 0 to 1
    difference = b - a
    return a + (difference * amount)
end

Edit

Ok I looked it up

function interpolate(a, b, amount)
    return a:lerp(b, amount)
end

1 comment

1

lovely stuff man, cheers

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