Skip to reading
GDScript Programming & Godot

lerp()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

Earlier edition reference / Current 0.86.4.0 property paths > p. 350

Code example
lerp(from: Variant, to: Variant, weight: Variant) -> Variant

Linear interpolation. A weight outside 0-1 can extrapolate.

lerp_angle()#

Code example
lerp_angle(from: float, to: float, weight: float) -> float

Interpolate angles along the appropriate circular route.

lerpf()#

Code example
lerpf(from: float, to: float, weight: float) -> float

Linear interpolation. A weight outside 0-1 can extrapolate.

linear_to_db()#

Code example
linear_to_db(lin: float) -> float

Convert audio amplitude between decibels and linear volume.

log()#

Code example
log(x: float) -> float

Exponential, natural logarithm, power or square root. Check the mathematical domain.

max()#

Code example
max(...) -> Variant

Largest supplied value; match typed/variadic signature.

maxf()#

Code example
maxf(a: float, b: float) -> float

Largest supplied value; match typed/variadic signature.

maxi()#

Code example
maxi(a: int, b: int) -> int

Largest supplied value; match typed/variadic signature.

Page 311 of 378Permalink
Go to page