---
description: >-
  This expression will create an animation that simulates a Type-on effect with
  a blinking cursor.
---

# After Effects Expression - Computer Type-on Animation

### Full step by step Tutorial:

{% embed url="https://www.instagram.com/p/CCRZaBOnxya/?utm_source=ig_web_copy_link" %}

Paste this code on the Source Text property:

```javascript
var blinkControl = Math.sin(time*Math.PI*5);
var inTime = marker.key(1).time;
var outTime = marker.key(2).time;
var animTime = linear(time, inTime, outTime, 0, text.sourceText.length);
var animation = text.sourceText.slice(0, animTime);

if (time <= inTime) {
	(blinkControl < 0)? "|" : "";
} else {
	(time < outTime)? animation+"|" : animation;
}
```

