Upgrading from older versions

Pro versions older than 1.0.000
or Free versions older than 1.2.000

  • BEFORE IMPORTING: create a "Plugins" folder at the root of your project (Assets/Plugins) and move the Demigiant folder in there (Assets/Plugins/Demigiant).
  • Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry.
  • Close and reopen Unity (and your project). This is fundamental.
  • Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup.
  • From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (activate external assets modules only if you have those assets in your project, otherwise errors will be thrown).

Pro versions older than 1.0.244
or Free versions older than 1.2.420

  • BEFORE IMPORTING: create a "Plugins" folder at the root of your project (Assets/Plugins) and move the Demigiant folder in there (Assets/Plugins/Demigiant).

Tips

  • Always kill a tween before its target is destroyed, or enable safe mode and let DOTween take care of it.
  • Even if they're resized automatically, try to set the tweens capacities to the max you'll use in your project (you can enable an editor report which will tell you the max you reached after playing).
  • Sequences don't need to contain tweens in a, uh, sequence. You can have overlapping tweens by using Insert instead of Append.

F.A.Q.

Basic

  • What is a tween engine?

    Read about it here.

  • HOTween to DOTween upgrade guide

    Read it here.

  • How to ignore Unity's Time.timeScale when tweening?

    Just chain the SetUpdate method to a tween, passing a value of TRUE to the isIndependentUpdate parameter.

    transform.DOMoveX(2, 1).SetUpdate(true);
  • How to change the speed of a tween?

    You can either change the speed of all tweens via DOTween.timeScale, or the speed of a single tween via myTween.timeScale.

    // Play all tweens at 2X speed
    								DOTween.timeScale = 2;
    								// Play a single tween at 2X speed
    								myTween.timeScale = 2;
  • What is the difference between SetRecyclable and SetAutoKill?

    DOTween's recycling feature comes in play AFTER a tween is killed. If a tween is never killed, it will never be recycled.

    Once a tween is killed, if it's set as recyclable it will be reset and dropped in a pool, to be reused when needed. Otherwise, it is completely destroyed.

    Consider that a tween's plugin, which means its internal main core, is always recycled independently of what happens to its tween and to the tween recycling settings. That's because DOTween uses a smart approach to plugins, so that only one plugin is used for each type of animation (Vector3, float, etc) at any time, independently of the number of tweens using it.

    NOTE: if you activate tween recycling, you'll have to take care of nulling your tween references once a tween is killed, otherwise they will still be valid but might point either to a pooled tween or to a completely new one (when the pooled one is called in play by another tween creation).

Errors

  • Unity finds multiple copies of DOTween

    This might happen if you didn't follow the above instructions when upgrading from a version of DOTween older than 1.2.420 or of DOTween Pro older than 1.0.244, and you didn't already have the "Demigiant" folder inside your "Assets/Plugins" folder. In that case find the "Demigiant" folder that is outside "Plugins" (it's probably in your project Assets root) and delete it.

  • [CLASS] does not contain a definition for [PROPERTY] and no accessible extension method [PROPERTY] accepting a first argument of type [CLASS] could be found (are you missing a using directive or an assembly reference?)

    This happens when your project contains a class ([CLASS]) with the same name of a Unity class but without namespace. In that case the namespace-less class will always prevail over Unity's own, and create API problems with any other class (in this case DOTween's) trying to use the original Unity one. To fix it find said [CLASS] and add a namespace to it.

  • DOColor or some other DOTween module's method doesn't show in the API

    There might be two reasons for this.
    1) Your own code is inside a custom DLL (or a custom ASMDEF), which means it has no access to loose Unity scripts. In this case just open DOTween's Utility Panel and click the Generate ASMDEF button, then add DOTween's ASMDEFs as a reference to your custom DLL/ASMDEF.
    2) Visual Studio went crazy (rare but happens), which means some external libraries APIs will be marked as red/non-existent even if Unity will compile the code without problems. In this case close Unity, delete all .csproj files from your project's root, finally reopen Unity and let it recreate the .csproj files when opening your code in VS again.

  • Crashes on UWP

    This is a Unity bug and they're working on it. In the meantime, disable safe mode to fix it. Note that this means you will have to kill tweens yourself when their target becomes NULL.

  • Tweens and callback targets inside foreach loops are not assigned correctly

    This is an error due to version of NET that Unity uses, where the target of a foreach is not considered unique as it should. To fix this, redeclare it inside the foreach loop like this:

    foreach (Transform myTarget in someList) {
    								    Transform t = myTarget; // redeclare
    								    t.DOMoveX(1, 1);
    								}
  • Error CS0433: The type 'Task' exists in both 'Unity.Tasks [...]' and 'netstandard [...]'

    This happens if you're using the Parse plugin and/or Firebase, since Parse adds an auto-reference to Unity.Task that eats every other Task reference regardless of correct usings and namespaces. It's a Parse bug and there's nothing that can be done on DOTween's side, so I recommend contacting Parse's author/s. In the meantime, you can remove the Unity.Tasks files that it automatically adds to your project, or at least uncheck the Auto Reference option from their Inspector

  • Unity Cloud Build can't find namespaces

    This can happen because GIT is often set to ignore DLL files, and thus it doesn't upload them to Unity Cloud. Be sure to enable DLL versioning and everything will work.

    P.S. as VeTaL notes, sometimes that nasty guy is hidden in gitignore_global.txt (on Windows the file is in %USERPROFILE%\.gitignore_global, in Mac it's in ~/.gitignore_global). In line 22, there's ".dll", so adding "#" at the beginning of the line fixes the issue.

  • References inside for loops within Coroutines are not passed correctly to callbacks

    This is an error that happens when using delegates inside Coroutines. To fix this, create the for loop outside of the coroutine:

    // Instead of this:
    								IEnumerator SomeCoroutine() {
    								    yield return new WaitForSeconds(1);
    								    for (int i = 0; i < someList.Length; ++i) {
    								        Transform t = someList[i];
    								        t.DOMoveX(1, 1).OnComplete(()=>MyMethod(t));
    								    }
    								}
    								// Do this:
    								IEnumerator SomeCoroutine() {
    								    yield return new WaitForSeconds(1);
    								    SomeLoop();
    								}
    								SomeLoop() {
    								    for (int i = 0; i < someList.Length; ++i) {
    								        Transform t = someList[i];
    								        t.DOMoveX(1, 1).OnComplete(()=>MyMethod(t));
    								    }
    								}
  • Unity says that DoMove (or another similar method) doesn't exist

    It's DOMove, with the first 3 letters in uppercase (unless you just forgot to import the DG.Tweening namespace).

  • DOTween Pro > Ease.INTERNAL_Custom doesn't exists error

    This happens if you have Mesh Maker in your project (which has an Ease class that has no namespace, so it will overwrite more "discreet" Ease classes like DOTween's). Mesh Maker's author was alerted and is kindly fixing it for its next release.

  • Errors when trying to tween NGUI elements that have anchors

    Nemial from Unity Forums encountered this issue and found the solution. Read all about it here.

Weird Things

  • DOTween ASMDEFs are auto-removed

    This can happen if A) you didn't create the ASMDEFs via DOTween's Utility panel, or B) DOTweenSettings.asset is not in source control and so it reverts to non-ASMDEF settings.

  • UI text disappears when DOTween is present in the Unity project

    This is a Unity bug with MDB files, which happens on some older versions. Delete all MDB files from DOTween (both the main folder and the Editor subfolder) and this will be solved.

    NOTE: MDB files are used only to report the correct line and full message in case of logs emitted by a DLL. Removing them won't change anything other then having less detailed DOTween logs.

Advanced

  • How does tween caching work?

    When you create your very first tween, that tween is instantiated as usual, but after that DOTween starts using a pooling system to recycle unused tweens (if recycling is active).

    Each time a tween is killed, that tween is not truly destroyed, but is instead reset, despawned and put in a pool, where it waits for you to need a similar tween again. When you do, DOTween checks its pool and sees if there's a suitable tween already. If there is, it despawns it and gives it back to you as if new but without instantiation and thus no GC allocations. If there isn't it instantiates a new one.

    DOTween requires a different type of tween for each type of value tweened and for Sequences. So for example a Tweener that animates a Vector3 can be recycled for another Vector3 but not for a float. A Sequence can instead be recycled for any other Sequence.

    Example

    Let's say we set the max tweens capacity to 10 Tweeners.

    At startup, we create 5 Vector3 tweens and 5 Quaternion tweens. Since the pool is empty they will all be instantiated. When they finish playing, our pool will contain 10 "empty" tweens.

    Now we create 5 new Vector3 tweens. Since the pool has them, they're spawned instead than instantiated. Again, we let them play and autokill.

    Now we create 5 float tweens. The pool doesn't contain float tweens, so instantiation will happen. Since the max number of pooled tweens has already been reached (it's the same as the tweens capacity, except that while active tween size is automatically incremented when needed, pool size always stays the same as the max active tweens) DOTween will destroy the oldest 5 tweens and instantiate the new ones.

    Tips

    If you just need the same tween over and over but with different values, it's even better to just store a reference to it and change its start/end value or duration directly.

  • Where are the plugins?

    If you ask this, I suppose you're used to how HOTween works, where you have to create a new plugin each time you want to use it. Well, I'm glad to say that plugins are still there, but undercover.

    Simply put, DOTween uses a single plugin instance for all the tweens that require that specific plugin, and it's all managed in the background, which means way way less GC allocations (actually only one per plugin type, the very first time you use it).

    Example

    In HOTween you needed to instantiate a PlugVector3Y plugin to tween just the Y axis of a transform:

    HOTween.To(transform, 1, new TweenParms()
    								  .Prop(new PlugVector3Y("position", 45))
    								);

    In DOTween instead, you just do this:

    transform.DOMoveY(45, 1);

Direct support

General talk and support

Write on this Unity forum thread to find help from other users or write me directly via Twitter or using Demigiant's contact form (if you're sending me code please paste it in something like Pastebin and write me the link).

Bugs, feature requests and suggestions

Please report bugs along with feature requests and suggestions on DOTween's GitHub area Issues (the Unity forum thread is also ok for quick bugfixes).

Remember to always write what version of DOTween are you using – you can see your version by opening DOTween's Utility Panel from the Tools menu.

Direct contact

You can contact me directly via Demigiant's website (if you're sending me code please paste it in something like Pastebin and write me the link).