Interpolation

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Interpolation

Interpolation is the process of inferring and calculating unknown values based on some data points and a formula.

When you use tweens or the animation editor in Godot, the engine calculates new values each frame based on your animation keyframes and easings. This is an example of interpolation.

For example, in this tween code, we animate a sprite moving from its current position to the position Vector2(500, 400) over 2 seconds:

var sprite_2d: Sprite2D = get_node("Sprite2D")
var tween := create_tween()
tween.tween_property(sprite_2d, "position", Vector2(500, 400), 2.0)

The tween calculates the sprite's position each frame based on the time elapsed over 2 seconds. If we don't specify a transition function, the tween object does this using linear interpolation: the sprite moves at a constant speed from its current position to the target position.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!