Bézier Curves Confusion

Could somebody explain how to tween a image label using a quadratic bézier curve, because I didn’t understand a single from roblox’s example that they provided.

roblox’s example

function lerp(a, b, c)
	return a + (b - a) * c
end
 
function quadBezier(t, p0, p1, p2)
	local l1 = lerp(p0, p1, t)
	local l2 = lerp(p1, p2, t)
	local quad = lerp(l1, l2, t)
	return quad
end

where are a, b and c defined
where is t, p0, p1, p2 defined

:exploding_head: :exploding_head: :exploding_head:

Well actually you ask « how a function work? ». I would suggest you to go back learn how to use functions. AlvinBlox made some good tutorials

I’ll look into functions, thanks I guess

But just to give you a small hint, let’s take a quick look at it. a, b and c are just some variable. When you call the function, you wil use numbers. Example you could use 1 for a, 2 for b and 3 for c so you will call the function like that:
lerp(1, 2, 3). The rest will be calculated by the function esrlier created on the script

1 Like

If we use 1, 2 ,3 we will have 1 + (2-1) *3

1 Like

You beat my by a second, I have to call the function giving the cords in the order of a b and c

Lol sorry but yeah, a function is how it work, and you have an example with numbers but it could be anything else

1 Like

Thanks a lot, This helped me a lot

Glad to hear that you understood :+1:

1 Like

Little note to add to this: the varying variables in functions are called parameters.

2 Likes

Oh yeah thanks, i forgot what was their names :+1:

1 Like