Skip to content

Instantly share code, notes, and snippets.

@Be1zebub
Created August 1, 2023 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Be1zebub/1e0bbb8d227c7df6803431447d686971 to your computer and use it in GitHub Desktop.
Save Be1zebub/1e0bbb8d227c7df6803431447d686971 to your computer and use it in GitHub Desktop.
math.BezierLerp.lua
local points = {
Vector( 128, 128 ),
Vector( 384, 128 ),
Vector( 128, 384 )
}
hook.Add( "HUDPaint", "math.BezierLerp", function()
local frac = RealTime() % 1
local point = math.BezierLerp( frac, points )
surface.SetDrawColor( 255, 255, 0 )
surface.DrawRect( point.x - 4, point.y - 4, 8, 8 )
end )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment