Hello, I'm NYDynamics and today I have attempted to script a Bezier curve Function. For some reason it returns in the output...
0,0,0(x3)
nil
Even though they have positions it returns 0,0,0??? It would be great if someone could help! My code is...
local P0 = workspace.P0
local P1 = workspace.P1
local P2 = workspace.P2
local tan = (P0.Position - P2.Position).magnitude
function lerp(a,b,c)
return print(a + (b-a) * c)
end
function quadBezier(tan,P0,P1,P2)
local L1 = lerp(Vector3.new(P0),Vector3.new(P1),tan)
local L2 = lerp(Vector3.new(P1),Vector3.new(P2),tan)
local quad = lerp(Vector3.new(L1),Vector3.new(L2),tan)
return print(quad)
end
quadBezier(tan,P0,P1,P2)

2 comments
First of all print returns nil, and in quadBezier you write "return print(quad)" instead of just "return quad" which means it will return nil
same problem in the lerp function