Skip to content

Instantly share code, notes, and snippets.

View h3r's full-sized avatar
🐦

Hermann Plass h3r

🐦
  • UPF-GTI
  • BCN
View GitHub Profile

Lerp vs SmoothDamp — Unity

The Problem

Vector3.Lerp with a fixed t in Update() is NOT smooth movement. It approaches the target exponentially — slowing forever, never truly arriving.

The Solution

Vector3.SmoothDamp accelerates toward the target and decelerates on arrival. It actually reaches the destination with physically believable motion.

@postspectacular
postspectacular / hsv2rgb.ino
Last active June 27, 2025 01:51
Super compact HSV/RGB conversions for Arduino/C
int redPin = 6;
int greenPin = 5;
int bluePin = 9;
float col[3];
float hue = 0.0;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);