Math.lerp visible in intellisense but is nil

math.lerp is displayed in intellisense, but the function does not exist.


Expected behavior

math.lerp should exist…

2 Likes

The function hasn’t been enabled yet, not sure why it was added to the intellisense a bit early though.

1 Like

Understood, then it’s poor user experience. Time to try CLI for the first time

Thank you for the report.

Closing as a duplicate.

Apologies for the outward frustration. I did test math.lerp in Luau via Homebrew and it’s nice to see the performance increase when calling math.lerp vs doing the arithmetic in Luau.

I would love to be able to do this via vector types too due to my current project working on a raytracing renderer, but there are other ways I can look into gaining performance.

Both vector2 and vector3 have a Lerp function which can be used directly on the data type. Is there a particular inefficiency / inaccuracy with these methods that math.lerp doesn’t have, or am I misunderstanding the use-case? I’m just genuinely curious about if there is something wrong with these functions as I’ve used them many-a-time.

1 Like

Trying to keep my code as pure Luau as possible for portability reasons.

HOWEVER.

I don’t know why I didn’t think of this, since I have already extracted some roblox datatype methods into localised functions for speed increases in perf. critical code, but I am able to pass Luau vector types into the Vector3 Lerp function, and it works! Thank you for saving me time on this.

My initial confusion is that the --!strict linter gets funny since vector and Vector3 is not really the same type, so I would probably just have to shut that up if I can.

EDIT: Just tried using Vector3.Lerp vs Luau math. It is still slower than performing arithmetic. Bleh.