DOTween (HOTween v2) - a Unity Tween Engine

DOTween is a fast, efficient, fully type-safe object-oriented animation engine for Unity, optimized for C# users, free and open-source, with tons of advanced features

It is also the evolution of HOTween, my previous Unity tween engine. Compared to it, DOTween is more than 400% faster, more efficient, more type-safe, avoids useless GC allocations and offers new shortcuts and features.

Features

Not only very fast, but also very efficient: everything is cached and reused to avoid useless GC allocations.

IntelliSense and type-safety

All code is complete with XML comments and organized to get the most out of IntelliSense. Also, everything is type-safe: no strings anywhere.

Shortcuts

Shortcut extensions that directly extend common objects like this:

// Move a transform to position 1,2,3 in 1 second
transform.DOMove(new Vector3(1,2,3), 1);
// Scale the Y of a transform to 3 in 1 second
transform.DOScaleY(3, 1);
// Pause a transform's tween
transform.DOPause();

Extremely accurate

Time is calculated in a very precise way. This means that 1000 loops of 1 second each will play exactly as long as a single loop of 1000 seconds.

Logical and easy to use API

An API made to boost efficiency, intuitiveness and ease of use.

Animate everything (almost)

DOTween can animate every numeric value and also some non-numeric ones. It can even animate strings, with support for rich-text.

Snapping, axis constraints and other options

Choose additional options on how to tween your values, like snapping (snaps values to integers) or axis constraints.

Full control

Play, Pause, Rewind, Restart, Complete, Goto and tons of other useful methods to control your tweens.

Grouping

Combine tweens into Sequences to create complex animations (which don't need to be in a, uh, sequence: they can also overlap each other).

Blendable tweens

Some tweens can blend between each other in realtime, thanks to powerful DOBlendable shortcuts.

Paths

Animate stuff along both linear and curved paths, with additional options for the orientation of your traveling agents.

Change values and duration while playing

Change a tween's start/end values or duration at any moment, even while playing.

Safe mode

Activate the optional safe mode and let DOTween take care of unexpected occurrences, like a tween's target being destroyed while playing.

Yield for coroutines

Various "WaitFor…" methods to use inside coroutines, that allow you to wait for a tween to be completed, killed, started, or for it to reach a given position or loops.

Multiple rotation modes

Rotation tweens can take the shortest route, the full one, or use local or world-based axes.

Shared methods

Is it a Tweener or a Sequence? Who cares? They both inherit from Tween, thus you can store them and control them in the same way.

Plugins

DOTween is built with an extensible architecture in mind, which allows you to create your own tween plugins as separate files.

Extras

Extra virtual methods to do stuff like calling a function after a given delay.

DOTween Utility Panel

DOTween Inspector

If you select the [DOTween] GameObject while playing, the corresponding Inspector will show you useful informations, plus buttons to directly open the online documentation and check if you have the latest version.

DOTween Pro

DOTween Pro is out and extends DOTween with new scripting shortcuts, a visual animation editor, a visual path editor, plus extra features for 2D Toolkit and TextMesh Pro.

DOTween VS HOTween

After gaining experience by spending the last years on HOTween, I created DOTween from scratch, with the aim of making the tween engine I truly wanted to use, so there's a lot of differences between the two. DOTween still maintains the flexible object-oriented approach of HOTween (actually, it's much more flexible), but also…

is much faster (both while running then when starting a tween), more efficient and uses less memory

All these tests were done from a build, since some of these tween engines (DOTween, HOTween and GoKit) do additional stuff while in the Editor to show editor-only debug informations, and thus testing them outside the editor, where it counts, seemed more fair.

To keep the test accurate download the latest versions of all engines and replace the old ones (the ones used here are from July/August 2014).

Generic floats

You'll find more tests for the tween of generic floats because GoKit and iTween couldn't tween as many as the other engines, but I still wanted to show high-level results.

64,000 generic floats in a loop

DOTween

HOTween

LeanTween

GoKit

iTween

Average FPS

124 FPS

25 FPS

102 FPS

freezes

freezes

Startup time

76 MS

332 MS

34 MS

freezes

freezes

16,000 generic floats in a loop

DOTween

HOTween

LeanTween

GoKit

iTween

Average FPS

412 FPS

115 FPS

389 FPS

387 FPS

freezes

Startup time

14 MS

74 MS

7 MS

47,432 MS

freezes

2,000 generic floats in a loop

DOTween

HOTween

LeanTween

GoKit

iTween

Average FPS

1091 FPS

888 FPS

1050 FPS

998 FPS

3 FPS

Startup time

2 MS

11 MS

1 MS

6,258 MS

240 MS

Transforms

4,000 transforms looping around

DOTween

HOTween

LeanTween

GoKit

iTween

Average FPS

68 FPS

63 FPS

68 FPS

65 FPS

38 FPS

Startup time

5 MS

30 MS

3 MS

130 MS

229 MS

Support DOTween

A lot of work went into DOTween and a lot more is to come. If you use it, like it, and want to support it, press this button to read more