Skip to reading
GDScript Programming & Godot

30. Speech, portraits, lip-sync and typewriter text

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
Code example
func run() -> void:
    await Say({
        "speakerId": "elias",
        "text": "Someone has been here before us.",
        "typewriter": true,
        "typewriterSpeed": 35,
        "typewriterSound": "default"
    })

Say uses the speaker’s configured speech/portrait route. ShowMessage is a narrator/message route. StartDialogue runs an authored conversation graph. A voice clip, portrait mapping and lip-sync track come from their configured assets; a plain string does not create those assets.

Typing sound can be default, none or custom. For custom, set typewriterSoundAssetId. For voiced speech, use voiceAssetId and the appropriate voice key/portrait settings shown in the action reference. Test both short and long lines, and check whether the line waits for continuation.

Use the game’s translation workflow for player-facing text. String.format and PCA’s Format build text; they do not automatically register a new translation entry.

Page 39 of 378Permalink
Go to page