The Startup
Published in

The Startup

You’re Using Lerp Wrong

Linear interpolation, or “lerp” for short, is a technique commonly used when programming things like games or GUIs. In principle, a lerp function “eases” the transition between two values over time, using some simple math. This could be used to slide a character between two coordinates, or to animate a change in size or opacity of a UI element. If you lerped between two colors, you’d get a gradient. The Unity game engine includes helper functions for Lerp in the Vector, Quaternion and floating point Math classes.




Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

The behavior of the objects

Plush Family DAO

Launch of ASSY Sushi staking

Step by Step to bridge Jewel to AVAX (as Jewel) — DeFi Kingdoms TLDR Guide

Keyboard shortcuts: 15 Untapped keyboard shortcuts in Windows 10 [2019]

Terraform Module Design

10 features of Magento development agency UK

Find Magento development agency in UK

A Cloud Guru Serverless Workshops

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matt Harzewski

Matt Harzewski

Programmer, blogger, robotics enthusiast.

More from Medium

Talking to your unmanaged code efficiently from Unity using P/Invoke — software design edition

Optimization — Caching WaitForSeconds In Unity Coroutines

Basics of Git Flow (featuring Emacs and Magit!)

Thymeleaf | Create dynamic hierarchy trees with Kotlin & Micronaut