Game Dev Cheat Sheet

Unity DOTween Quick Reference

Searchable cheat sheet for every common DOTween method. Click copy to grab C# code snippets for your Unity project.

DOTween is the most popular tweening library for Unity, but its documentation can be hard to scan when you just need the syntax. This searchable reference covers every common DOTween method with one-line descriptions and copy-paste code, so you can find what you need in seconds. For full documentation, visit the official DOTween website.

Category:

Transform

DOMove

Click to preview

Move to a world position

transform.DOMove(new Vector3(0, 5, 0), 1f);

DOLocalMove

Click to preview

Move to a local position

transform.DOLocalMove(new Vector3(0, 5, 0), 1f);

DORotate

Click to preview

Rotate to target euler angles

transform.DORotate(new Vector3(0, 180, 0), 1f);

DOLocalRotate

Click to preview

Rotate in local space

transform.DOLocalRotate(new Vector3(0, 180, 0), 1f);

DOScale

Click to preview

Scale to target size

transform.DOScale(Vector3.one * 2f, 1f);

DOJump

Click to preview

Jump to position with arc

transform.DOJump(new Vector3(5, 0, 0), 2f, 1, 1f);

DOPunchPosition

Click to preview

Punch offset and return

transform.DOPunchPosition(new Vector3(0, 1, 0), 0.5f);

DOPunchRotation

Click to preview

Punch rotation and return

transform.DOPunchRotation(new Vector3(0, 0, 30), 0.5f);

DOPunchScale

Click to preview

Punch scale and return

transform.DOPunchScale(Vector3.one * 0.3f, 0.5f);

DOShakePosition

Click to preview

Shake position randomly

transform.DOShakePosition(0.5f, 0.5f);

DOShakeRotation

Click to preview

Shake rotation randomly

transform.DOShakeRotation(0.5f, 30f);

DOShakeScale

Click to preview

Shake scale randomly

transform.DOShakeScale(0.5f, 0.5f);

DOPath

Click to preview

Move along a path of waypoints

transform.DOPath(waypoints, 3f, PathType.CatmullRom);

DOLookAt

Click to preview

Rotate to look at target

transform.DOLookAt(target.position, 1f);

Material / Renderer

DOColor (Material)

Click to preview

Fade material to target colour

material.DOColor(Color.red, 1f);

DOFade (Material)

Click to preview

Fade material alpha

material.DOFade(0f, 1f);

DOColor (SpriteRenderer)

Click to preview

Fade sprite to target colour

spriteRenderer.DOColor(Color.red, 1f);

DOFade (SpriteRenderer)

Click to preview

Fade sprite alpha

spriteRenderer.DOFade(0f, 1f);

UI

DOAnchorPos

Click to preview

Move UI element to anchored position

rectTransform.DOAnchorPos(new Vector2(100, 0), 0.5f);

DOSizeDelta

Click to preview

Resize UI element

rectTransform.DOSizeDelta(new Vector2(200, 100), 0.5f);

DOFade (CanvasGroup)

Click to preview

Fade entire UI group

canvasGroup.DOFade(0f, 0.3f);

DOFillAmount

Click to preview

Animate fill amount (health bars, loading)

image.DOFillAmount(1f, 0.5f);

DOText

Click to preview

Typewriter text reveal (legacy Text only)

textComponent.DOText("Hello World", 1f);
// TMP users: DOText does not work with TextMeshPro.
// For TMP, either install DOTween Pro (paid, includes
// DOText for TMP), or use DOTween.To to animate
// maxVisibleCharacters (see Common Recipes below).

Sequence

Chain multiple tweens, pauses, and callbacks into a single sequence.

Sequence seq = DOTween.Sequence();
seq.Append(transform.DOMove(new Vector3(5, 0, 0), 1f));
seq.Join(transform.DORotate(new Vector3(0, 180, 0), 1f));
seq.AppendInterval(0.5f);
seq.Append(transform.DOScale(Vector3.one * 2f, 0.5f));
seq.AppendCallback(() => Debug.Log("Sequence complete"));
seq.SetLoops(2, LoopType.Yoyo);
  • Append adds a tween to the end of the sequence
  • Join adds a tween that plays at the same time as the previous one
  • AppendInterval adds a pause
  • AppendCallback fires a callback at that point in the sequence
  • SetLoops loops the entire sequence

Common Modifiers

Chain these onto any tween to customise its behaviour.

Set easing curve

.SetEase(Ease.OutCubic)

Delay before starting

.SetDelay(0.5f)

Loop the tween (use -1 for infinite)

.SetLoops(3, LoopType.Restart)

Callback when tween finishes

.OnComplete(() => { })

Callback every frame during tween

.OnUpdate(() => { })

Treat target as relative offset

.SetRelative()

Tween FROM target to current value

.From()

Keep tween alive after completion

.SetAutoKill(false)

Tag tween for later control

.SetId("myTween")

Kill tweens by ID

DOTween.Kill("myTween")

Kill all active tweens

DOTween.KillAll()

Common Recipes

Complete, production-ready code blocks for patterns developers search for frequently.

Button Press Feedback

Scale down, bounce back, and flash colour on press.

Sequence seq = DOTween.Sequence();
seq.Append(rt.DOScale(0.9f, 0.05f).SetEase(Ease.InQuad));
seq.Append(rt.DOScale(1f, 0.15f).SetEase(Ease.OutBack));
seq.Join(image.DOColor(Color.white, 0.05f));
seq.Append(image.DOColor(originalColour, 0.1f));

Health Bar Smooth Drain

Smooth health bar that drains with a slight delay.

fillImage.DOFillAmount(targetFill, 0.4f)
    .SetEase(Ease.InOutQuad)
    .SetDelay(0.1f);

Screen Shake

Camera shake for impacts. Adjust strength by damage.

Camera.main.transform.DOShakePosition(
    duration: 0.3f,
    strength: intensity,
    vibrato: 15,
    randomness: 90,
    fadeOut: true
);

UI Panel Slide In

Slide a panel in from the right side of the screen.

// Show
panel.anchoredPosition = new Vector2(Screen.width, 0);
panel.DOAnchorPos(Vector2.zero, 0.35f)
    .SetEase(Ease.OutCubic);

// Hide
panel.DOAnchorPos(new Vector2(Screen.width, 0), 0.25f)
    .SetEase(Ease.InCubic)
    .OnComplete(() => panel.gameObject.SetActive(false));

Fade and Destroy

Fade out a SpriteRenderer then destroy the GameObject.

sr.DOFade(0f, 0.5f)
    .SetEase(Ease.InQuad)
    .OnComplete(() => Destroy(sr.gameObject));

Floating Damage Number

Float up and fade out a damage number.

Sequence seq = DOTween.Sequence();
seq.Append(tmp.transform.DOMoveY(
    tmp.transform.position.y + 1.5f, 0.8f)
    .SetEase(Ease.OutQuad));
seq.Join(tmp.DOFade(0f, 0.8f)
    .SetEase(Ease.InQuad));
seq.OnComplete(() => Destroy(tmp.gameObject));

Typewriter (TextMeshPro, free method)

Typewriter effect for dialogue text using DOTween.To and maxVisibleCharacters. Works with TMP without DOTween Pro.

tmp.text = text;
tmp.maxVisibleCharacters = 0;
DOTween.To(
    () => tmp.maxVisibleCharacters,
    x => tmp.maxVisibleCharacters = x,
    text.Length,
    text.Length / 30f  // 30 chars per second
).SetEase(Ease.Linear);

Looping Hover / Breathing

Gentle hover or breathing effect for idle objects.

target.DOScale(1.1f, 1.2f)
    .SetEase(Ease.InOutSine)
    .SetLoops(-1, LoopType.Yoyo);

Frequently asked questions

How do I tween a TextMeshPro text value with DOTween?
Use the DOTween Pro extensions or the free DOTween TextMeshPro module. The shortcut is text.DOText("New text", duration). For colour, use text.DOColor(targetColor, duration). DOTween Pro is required for the cleanest TextMeshPro shortcuts.
How do I chain tweens in DOTween?
Use DOTween.Sequence(). Append tweens with seq.Append(tween) for sequential, or seq.Join(tween) to run alongside the previous one. Use seq.AppendInterval(0.5f) to add delays between steps.
How do I kill a DOTween tween early?
Store the Tween reference and call .Kill() on it. To kill all tweens on a target, use myTransform.DOKill(). To kill all tweens globally, DOTween.KillAll(). Avoid leaking tweens by killing them in OnDisable when the target object is pooled or destroyed.
Why does my DOTween tween snap back at the end?
The most common cause is starting a new tween on the same property before the previous one finishes. DOTween will fight itself. Either kill the previous tween first, or use .SetAutoKill(false) and replay it. Also check that nothing else (Animator, physics) is overwriting the value.

Last updated: