4.25.2014

The Subtle Magic of InterpTo()

By Jeff Farris

There’s a certain amount of craftsmanship involved in making things move around algorithmically.  Getting a camera to slide smoothly into position, gliding on the gossamer wings of math, can be a perilous underataking.  One wrong wobble, one tiny pop, and every pixel on the screen becomes wrong, the needle slides off the record, and the magic spell is broken.

Enter one of my favorite tools in the Unreal Engine toolbox: the InterpTo() functions, available in C++ or in Blueprints.

Programming screenshot

Blueprints Screenshot

They exhibit fast exit behavior, accelerating instantly.  They have a silky smooth arrival characteristic, and they terminate without a noticeable pop in a reasonable timeframe.

They’re great for smoothing out discontinuities.  They can deliver a sense of momentum and “weight”.

They’re perfect for interpolations with an indeterminate endpoint.  Try setting up a “pursuit” scenario – your actual value ever-interpolating toward the ideal goal value – and you’ll get a satisfying and highly tunable “flexiness”.

They’re framerate-independent. Enough, anyway.

They’re fun at parties.

In short, they’re a valuable tool in the Unreal Engine toolbox and worth getting to know. And as always, if you have any questions or inspiring interpolation-related anecdotes to share, drop by the forums!

Recent Posts

Bloodstained: Ritual of the Night Aims to Stand Out from Castlevania in a Big Way

What started as a modest Kickstarter campaign burgeoned into one of the crowdfunding platform’s greatest successes. We chat with Koji Igarashi himself about the game’s journey.

 

Unreal Engine Developers Come Out On Top at E3 2018

From the bright lights of major press events to the bustling show floor and...

How Real-Time Tech Is Changing The Auto Design Landscape

The world of automotive design is in flux, with real-time technology drivin...