Interpolation
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
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.
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.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…