Yarn Spinner 3 is now available!
Buy Now
LogoLogo
HomepageDiscordItchPatreonAsset Store
Yarn Spinner 3.0
Yarn Spinner 3.0
  • ⭐Start Here
    • Yarn Spinner 3
  • Beginner's Guide
  • About Yarn Spinner
  • Crediting Yarn Spinner
  • FAQ
  • Writing Yarn Scripts
    • ⭐First Steps with Scripting
    • Yarn Spinner Editor
      • Writing Yarn in VS Code
      • Previewing Your Dialogue
      • Writing Together
    • Scripting Fundamentals
      • Nodes and Lines
      • Options
      • Jump Command
      • Detour Command
      • Variables
      • Flow Control
      • Once
      • Smart Variables
      • Enums
      • Commands
      • Functions
      • Line Groups
    • Advanced Scripting
      • Node Groups
      • Storylets and Saliency Primer
      • Saliency
      • Tags and Metadata
      • Markup
      • Shadow Lines
  • Yarn Spinner for Unity
    • ⭐First Steps with Unity
    • Installation for Unity
      • Unity Quick Start
    • Yarn Spinner in Unity Scenes
      • Unity Projects + Yarn Spinner
    • Your First Yarn Spinner Game
    • Commands and Functions
    • Localisation and Assets
      • In-built Localisation
      • Unity Localisation
    • Samples
      • Welcome
      • Feature Tour
      • Theming Default Presenters
      • Create a Phone Chat View
      • Make Options Timeout
      • Voice Over and Localisation
      • Background Chatter
      • Inline Events
      • Replacement Markup
      • Storylets and Saliency
        • Basics Storylets and Saliency
        • Advanced Saliency
        • Custom Saliency Strategies
    • Unity Add-Ons
      • Speech Bubbles
        • Installing Speech Bubbles
        • Using Speech Bubbles
        • Speech Bubble Examples
      • Dialogue Wheel
        • Installing Dialogue Wheel
        • Using Six-Segment Wheel
        • Using Auto-Layout Wheel
        • Dialogue Wheel Examples
  • Components
    • Dialogue Runners and Systems
    • Dialogue Presenters
      • Line Presenter
      • Options Presenter
      • Line Advancer
      • Custom Dialogue Presenters
    • Variable Storage
      • In-Memory Variable Storage
      • Variable Storage
      • Custom Variable Storage Components
    • Line Provider
      • Built-in Localised Line Provider
      • Unity Localised Line Provider
    • Asynchronous Programming
  • Changelog
    • Upgrading from Yarn Spinner 2
  • Yarn Spinner for Other Engines
    • Godot
      • Overview
      • 📦Installation for Godot
      • 📥Importing Yarn Files
        • Yarn Projects
        • Yarn Scripts
      • 🧱Components
        • Dialogue Runner
        • Dialogue Views
          • Line View
          • Options List View
          • Option View
          • Creating Custom Dialogue Views
        • Variable Storage
          • In-Memory Variable Storage
          • Custom Variable Storage Components
        • Line Provider
          • Text Line Provider
        • Markup Palette
      • 🤖Commands and Functions
      • 🗺️Localization
      • Advanced Guides
        • Implementing Custom Variable Storage
    • Unreal
      • 🧑🏼‍🏫Unreal Beta Quickstart
    • Bevy
      • ⚡Bevy Quick Start
      • 📥Compiling Yarn Files into Yarn Projects
      • 🧱Components
        • Dialogue Runner and a High Level Overview
        • Dialogue Views
        • Variable Storage
        • Assets
      • 🤖Custom Commands and Functions
        • Commands
        • Functions
      • 🗺️Localisations
      • 💡Frequently Asked Questions / "How Do I...?"
      • 🎁Bevy Samples
  • API
    • C#
      • Yarn.Utility Namespace
        • CRC32
          • GetChecksum(byte[])
          • GetChecksum(string)
          • GetChecksumString(string)
      • Yarn Namespace
        • Command
          • Text
        • CommandHandler
        • ConstantTypeProperty
          • Description
          • Type
          • Value
        • Dialogue
          • DefaultStartNodeName
          • Dialogue(Yarn.IVariableStorage)
          • Continue()
          • GetHeaders(string)
          • GetHeaderValue(string,string)
          • GetSaliencyOptionsForNodeGroup(string)
          • GetStringIDForNode(string)
          • GetTagsForNode(string)
          • HasSalientContent(string)
          • IsNodeGroup(string)
          • NodeExists(string)
          • SetNode(string)
          • SetProgram(Program)
          • SetSelectedOption(int)
          • Stop()
          • TryGetSmartVariable(string,T)
          • UnloadAll()
          • CommandHandler
          • ContentSaliencyStrategy
          • CurrentNode
          • DialogueCompleteHandler
          • IsActive
          • Library
          • LineHandler
          • LogDebugMessage
          • LogErrorMessage
          • NodeCompleteHandler
          • NodeNames
          • NodeStartHandler
          • OptionsHandler
          • PrepareForLinesHandler
          • VariableStorage
        • DialogueCompleteHandler
        • DialogueException
        • EnumBase
          • EnumBase()
          • Description
          • Name
          • Parent
        • EnumType
          • EnumType(string,string,TypeBase)
          • Description
          • EnumCases
          • Name
          • Parent
          • RawType
        • FunctionType
          • FunctionType(IType,IType[])
          • Equals(IType)
          • GetParameterAt(int)
          • ToString()
          • Description
          • Name
          • Parameters
          • Parent
          • ReturnType
          • TypeMembers
          • VariadicParameterType
        • Header
          • KeyFieldNumber
          • ValueFieldNumber
          • Header()
          • Header(Header)
          • CalculateSize()
          • Clone()
          • Equals(object)
          • Equals(Header)
          • GetHashCode()
          • MergeFrom(pb::CodedInputStream)
          • MergeFrom(Header)
          • ToString()
          • WriteTo(pb::CodedOutputStream)
          • Descriptor
          • Key
          • Parser
          • Value
        • IMarkupParser
          • ParseMarkup(string,string)
        • ISmartVariableEvaluator
          • TryGetSmartVariable(string,T)
        • IType
          • Description
          • Name
          • Parent
          • TypeMembers
        • ITypeMember
          • Type
        • IVariableAccess
          • GetVariableKind(string)
          • TryGetValue(string,T?)
          • Program
          • SmartVariableEvaluator
        • IVariableStorage
          • Clear()
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
        • IYarnValue
          • ConvertTo()
        • Library
          • DeregisterFunction(string)
          • FunctionExists(string)
          • GenerateUniqueVisitedVariableForNode(string)
          • GetFunction(string)
          • ImportLibrary(Library)
          • RegisterFunction(string,Delegate)
          • RegisterFunction(string,Func<TResult>)
          • RegisterFunction(string,Func<T1, TResult>)
          • RegisterFunction(string,Func<T1, T2, TResult>)
          • RegisterFunction(string,Func<T1, T2, T3, TResult>)
          • RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)
          • RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)
        • Line
          • Line(string,string[])
          • ID
          • Substitutions
        • LineHandler
        • Logger
        • MemoryVariableStore
          • Clear()
          • GetVariableKind(string)
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
          • TryGetValue(string,T?)
          • Program
          • SmartVariableEvaluator
        • Node
          • NodeGroupHeader
          • ToString()
          • ContentSaliencyConditionComplexityScore
          • ContentSaliencyConditionVariables
          • Headers
          • Instructions
          • IsNodeGroupHub
          • Name
          • NodeGroup
          • Tags
          • TrackingVariableName
        • NodeCompleteHandler
        • NodeStartHandler
        • OptionSet
          • Options
          • Option
            • ID
            • IsAvailable
            • Line
        • OptionsHandler
        • PrepareForLinesHandler
        • Program
          • GetVariableKind(string)
          • LineIDsForNode(string)
          • ToString()
          • TryGetInitialValue(string,T)
          • InitialValues
          • Name
          • Nodes
        • TypeBase
          • Equals(object)
          • Equals(TypeBase)
          • GetHashCode()
          • IsAncestorOf(TypeBase)
          • IsConvertibleTo(TypeBase)
          • ToString()
          • ConvertibleToTypes
          • Description
          • Methods
          • Name
          • Parent
          • TypeMembers
        • Types
          • Any
          • Boolean
          • Number
          • String
          • TypeMappings
        • VariableKind
          • Smart
          • Stored
          • Unknown
      • Yarn.Saliency Namespace
        • BestLeastRecentlyViewedSaliencyStrategy
          • BestLeastRecentlyViewedSaliencyStrategy(IVariableStorage)
          • ContentWasSelected(ContentSaliencyOption)
          • QueryBestContent(IEnumerable<ContentSaliencyOption>)
        • BestSaliencyStrategy
          • ContentWasSelected(ContentSaliencyOption)
          • QueryBestContent(IEnumerable<ContentSaliencyOption>)
        • ContentSaliencyContentType
          • Line
          • Node
        • ContentSaliencyOption
          • ContentSaliencyOption(string)
          • ComplexityScore
          • ContentID
          • ContentType
          • FailingConditionValueCount
          • PassingConditionValueCount
          • ViewCountKey
        • EnumerableRandomExtension
          • RandomElement(IEnumerable<T>)
        • FirstSaliencyStrategy
          • ContentWasSelected(ContentSaliencyOption)
          • QueryBestContent(IEnumerable<ContentSaliencyOption>)
        • IContentSaliencyStrategy
          • ContentWasSelected(ContentSaliencyOption)
          • QueryBestContent(IEnumerable<ContentSaliencyOption>)
        • RandomBestLeastRecentlyViewedSaliencyStrategy
          • RandomBestLeastRecentlyViewedSaliencyStrategy(IVariableStorage)
          • ContentWasSelected(ContentSaliencyOption)
          • QueryBestContent(IEnumerable<ContentSaliencyOption>)
      • Yarn.Markup Namespace
        • BuiltInMarkupReplacer
          • ProcessReplacementMarker(MarkupAttribute,StringBuilder,List<MarkupAttribute>,string)
        • IAttributeMarkerProcessor
          • ProcessReplacementMarker(MarkupAttribute,System.Text.StringBuilder,List<MarkupAttribute>,string)
        • LineParser
          • CharacterAttribute
          • CharacterAttributeNameProperty
          • NoMarkupAttribute
          • ReplacementMarkerContents
          • TrimWhitespaceProperty
          • DeregisterMarkerProcessor(string)
          • Dispose()
          • ExpandSubstitutions(string,IList<string>)
          • ParseString(string,string,bool)
          • RegisterMarkerProcessor(string,IAttributeMarkerProcessor)
          • MarkupDiagnostic
            • MarkupDiagnostic(string,int)
            • Equals(object)
            • Equals(MarkupDiagnostic)
            • GetHashCode()
            • M:Yarn.Markup.LineParser.MarkupDiagnostic.op_Equality(Yarn.Markup.LineParser.MarkupDiagnostic,Yarn.Markup.LineParser.MarkupDiagnostic)
            • M:Yarn.Markup.LineParser.MarkupDiagnostic.op_Inequality(Yarn.Markup.LineParser.MarkupDiagnostic,Yarn.Markup.LineParser.MarkupDiagnostic)
            • Column
            • Message
        • MarkupAttribute
          • Shift(int)
          • ToString()
          • TryGetProperty(string,bool)
          • TryGetProperty(string,int)
          • TryGetProperty(string,float)
          • TryGetProperty(string,string?)
          • TryGetProperty(string,MarkupValue)
          • Length
          • Name
          • Position
          • Properties
        • MarkupParseException
        • MarkupParseResult
          • MarkupParseResult(string,List<MarkupAttribute>)
          • DeleteRange(MarkupAttribute)
          • TextForAttribute(MarkupAttribute)
          • TryGetAttributeWithName(string,MarkupAttribute)
          • Attributes
          • Text
        • MarkupProperty
          • Name
          • Value
        • MarkupValue
          • ToString()
          • ToString(IFormatProvider)
          • BoolValue
          • FloatValue
          • IntegerValue
          • StringValue
          • Type
        • MarkupValueType
          • Bool
          • Float
          • Integer
          • String
        • TagType
          • Close
          • CloseAll
          • Open
          • SelfClosing
      • Yarn.Compiler Namespace
        • CompilationJob
          • CompilationType
          • Declarations
          • Files
          • Library
          • CreateFromFiles(IEnumerable<string>,Library?)
          • CreateFromFiles(string[])
          • CreateFromString(string,string,Library?,int)
          • CancellationToken
          • LanguageVersion
          • TypeDeclarations
          • VariableDeclarations
          • File
            • FileName
            • Source
          • Type
            • DeclarationsOnly
            • FullCompilation
            • StringsOnly
            • TypeCheck
        • CompilationResult
          • GetDescriptionForVariable(string)
          • GetLabelsForNode(string)
          • GetStringForKey(string)
          • ContainsErrors
          • ContainsImplicitStringTags
          • DebugInfo
          • Declarations
          • Diagnostics
          • FileTags
          • Program
          • ProjectDebugInfo
          • StringTable
          • UserDefinedTypes
        • Compiler
          • Compile(CompilationJob)
          • FlattenParseTree(IParseTree)
          • GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)
          • GetLineIDForNodeName(string)
        • Declaration
          • ExternalDeclaration
          • CreateVariable(string,IType,IConvertible,string?)
          • ToString()
          • DefaultValue
          • Dependencies
          • Dependents
          • Description
          • InitialValueParserContext
          • IsImplicit
          • IsInlineExpansion
          • IsVariable
          • Name
          • Range
          • SourceFileLine
          • SourceFileName
          • SourceNodeName
          • Type
        • DeclarationBuilder
          • WithDefaultValue(System.IConvertible)
          • WithDescription(string?)
          • WithImplicit(bool)
          • WithName(string)
          • WithRange(Yarn.Compiler.Range)
          • WithSourceFileName(string)
          • WithSourceNodeName(string)
          • WithType(IType)
          • Declaration
        • Diagnostic
          • Diagnostic(string,IToken,string,DiagnosticSeverity)
          • Diagnostic(string,ParserRuleContext?,string,DiagnosticSeverity)
          • Diagnostic(string,string,DiagnosticSeverity)
          • Diagnostic(string,DiagnosticSeverity)
          • Diagnostic(string,Range,string,DiagnosticSeverity)
          • Equals(object)
          • GetHashCode()
          • ToString()
          • Column
          • Context
          • FileName
          • Line
          • Message
          • Range
          • Severity
          • DiagnosticSeverity
            • Error
            • Info
            • Warning
        • EnumTypeBuilder
          • FromEnum(string?)
        • FileParseResult
          • FileParseResult(string,IParseTree,CommonTokenStream)
          • Equals(object)
          • GetHashCode()
          • Name
          • Tokens
          • Tree
        • FunctionTypeBuilder
          • FromFunctionType(System.Type)
          • WithParameter(IType)
          • WithReturnType(IType)
          • WithVariadicParameterType(IType?)
          • FunctionType
        • IndentAwareLexer
          • IndentAwareLexer(ICharStream,TextWriter,TextWriter)
          • IsInWhenClause()
          • NextToken()
          • SetInWhenClause(bool)
          • Warnings
          • LexerWarning
            • Message
            • Token
        • NodeDebugInfo
          • NodeDebugInfo(string?,string)
          • GetLineInfo(int)
          • FileName
          • IsImplicit
          • NodeName
          • Range
          • LineInfo
            • FileName
            • NodeName
            • Position
        • Position
          • Equals(object)
          • GetHashCode()
          • M:Yarn.Compiler.Position.op_GreaterThanOrEqual(Yarn.Compiler.Position,Yarn.Compiler.Position)
          • M:Yarn.Compiler.Position.op_LessThanOrEqual(Yarn.Compiler.Position,Yarn.Compiler.Position)
          • ToString()
          • Character
          • IsValid
          • Line
        • Project
          • CurrentProjectFileVersion
          • WorkspaceRootPlaceholder
          • YarnSpinnerProjectVersion2
          • YarnSpinnerProjectVersion3
          • Project()
          • Project(string,string?)
          • GetJson()
          • IsMatchingPath(string)
          • IsValidVersionNumber(int)
          • LoadFromFile(string,string?)
          • SaveToFile(string)
          • AllowLanguagePreviewFeatures
          • BaseLanguage
          • CompilerOptions
          • Definitions
          • DefinitionsFiles
          • DefinitionsPath
          • ExcludeFilePatterns
          • ExtensionData
          • FileVersion
          • Localisation
          • Path
          • SourceFilePatterns
          • SourceFiles
          • WorkspaceRootPath
          • LocalizationInfo
            • Assets
            • Strings
        • ProjectDebugInfo
          • GetNodeDebugInfo(string)
          • Nodes
        • Range
          • Range()
          • Range(int,int,int,int)
          • Equals(object)
          • GetHashCode()
          • ToString()
          • End
          • IsValid
          • Start
        • StringInfo
          • fileName
          • isImplicitTag
          • lineNumber
          • metadata
          • nodeName
          • shadowLineID
          • text
          • ToString()
        • Utility
          • AddTagsToLines(string,ICollection<string>?)
          • DetermineNodeConnections(string[])
          • ExtractStringBlocks(IEnumerable<Node>,ProjectDebugInfo)
          • GenerateYarnFileWithDeclarations(IEnumerable<Yarn.Compiler.Declaration>,string,IEnumerable<string>?,IDictionary<string, string>?)
          • GetCompiledCodeAsString(Program,Library?,CompilationResult?)
          • GetYarnValue(IConvertible)
          • ParseSource(string)
          • TagLines(string,ICollection<string>?)
          • TryGetNodeTitle(string?,YarnSpinnerParser.NodeContext,string?,string?,string?,string?)
      • Yarn.Compiler.Upgrader Namespace
        • LanguageUpgrader
          • Upgrade(UpgradeJob)
        • TextReplacement
          • Comment
          • OriginalText
          • ReplacementText
          • Start
          • StartLine
          • OriginalLength
          • ReplacementLength
        • UpgradeJob
          • Files
          • UpgradeType
          • UpgradeJob(UpgradeType,IEnumerable<CompilationJob.File>)
        • UpgradeResult
          • Files
          • Diagnostics
          • OutputFile
            • Diagnostics
            • IsNewFile
            • OriginalSource
            • Path
            • Replacements
            • UpgradedSource
        • UpgradeType
          • Version1to2
      • Yarn.Unity Namespace
        • Actions
          • Actions(IActionRegistration,Library)
          • AddCommandHandler(string,Delegate)
          • AddCommandHandler(string,Func<object>)
          • AddCommandHandler(string,MethodInfo)
          • AddFunction(string,Delegate)
          • AddRegistrationMethod(ActionRegistrationMethod)
          • RegisterActions()
          • RegisterFunctionDeclaration(string,Type,Type[])
          • RemoveCommandHandler(string)
          • RemoveFunction(string)
          • SetupForProject(YarnProject)
          • ActionRegistrar
          • Commands
          • Library
        • BuiltinLocalisedLineProvider
          • DeregisterMarkerProcessor(string)
          • GetLocalizedLineAsync(Line,CancellationToken)
          • PrepareForLinesAsync(IEnumerable<string>,CancellationToken)
          • RegisterMarkerProcessor(string,Markup.IAttributeMarkerProcessor)
          • AssetLocaleCode
          • LocaleCode
        • Effects
          • FadeAlpha(CanvasGroup,float,float,float,CancellationToken)
          • FadeAlpha(CanvasGroup,float,float,float,CoroutineInterruptToken?)
          • FadeAlphaAsync(CanvasGroup,float,float,float,CancellationToken)
          • PausableTypewriter(TextMeshProUGUI,float,Action?,Action?,Action?,Stack<(int position, float duration)>?,CoroutineInterruptToken?)
          • Typewriter(TextMeshProUGUI,float,Action,CoroutineInterruptToken?)
          • CoroutineInterruptToken
            • Complete()
            • Interrupt()
            • Start()
            • CanInterrupt
            • WasInterrupted
        • ICommand
          • Name
        • ILineProvider
          • DeregisterMarkerProcessor(string)
          • GetLocalizedLineAsync(Line,CancellationToken)
          • PrepareForLinesAsync(IEnumerable<string>,CancellationToken)
          • RegisterMarkerProcessor(string,Yarn.Markup.IAttributeMarkerProcessor)
          • LocaleCode
          • YarnProject
        • LineProviderBehaviour
          • DeregisterMarkerProcessor(string)
          • GetLocalizedLineAsync(Line,CancellationToken)
          • PrepareForLinesAsync(IEnumerable<string>,CancellationToken)
          • RegisterMarkerProcessor(string,IAttributeMarkerProcessor)
          • Start()
          • LocaleCode
          • YarnProject
        • LocalizedLine
          • Asset
          • InvalidLine
          • Metadata
          • RawText
          • Substitutions
          • TextID
          • CharacterName
          • Text
          • TextWithoutCharacterName
        • MarkupPalette
          • BasicMarkers
          • CustomMarkers
          • ColorForMarker(string,Color)
          • PaletteForMarker(string,CustomMarker)
          • BasicMarker
            • Boldened
            • Color
            • CustomColor
            • Italicised
            • Marker
            • Strikedthrough
            • Underlined
          • CustomMarker
            • End
            • Marker
            • MarkerOffset
            • Start
        • RegistrationType
          • Compilation
          • Runtime
        • YarnActionAttribute
          • Name
        • YarnCommandAttribute
        • YarnFunctionAttribute
      • Yarn.Unity.UnityLocalization Namespace
        • LineMetadata
          • nodeName
          • tags
          • ShadowLineSource
        • UnityLocalisedLineProvider
          • DeregisterMarkerProcessor(string)
          • GetLocalizedLineAsync(Line,CancellationToken)
          • PrepareForLinesAsync(IEnumerable<string>,CancellationToken)
          • RegisterMarkerProcessor(string,IAttributeMarkerProcessor)
          • LocaleCode
    • Rust
      • bevy_yarnspinner
      • bevy_yarnspinner_example_dialogue_view
      • yarnspinner
Powered by GitBook
LogoLogo

Community

  • Discord
  • Bluesky
  • Mastodon

Support Our Work

  • Itch
  • Unity Asset Store
  • Patreon

Yarn Spinner® and Secret Lab® are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.

On this page
  • Terminology
  • Setting up for Speech Bubbles
  • Adding Bubbles to Characters
  • Playing with Bubbles

Was this helpful?

Edit on GitHub
Export as PDF
  1. Yarn Spinner for Unity
  2. Unity Add-Ons
  3. Speech Bubbles

Using Speech Bubbles

Learn how to use the Speech Bubbles, from the Speech Bubbles for Yarn Spinner Add-On Package.

PreviousInstalling Speech BubblesNextSpeech Bubble Examples

Last updated 3 days ago

Was this helpful?

The Speech Bubbles Add-On provides a flexible speech bubble system with a variety of possible customisations. Here, you'll learn how to implement it in a Unity project by looking at a super simple side-scrolling game.

Terminology

There are a few different pieces to the speech bubbles which are worth just quickly clarifying. First is the bubble dialogue view which is the code that talks to Yarn Spinner and handles the interaction with the dialogue side of things.

Next is the bubble, this handles the positional and tracking code for where the bubble lives on the screen. As part of the bubble is it's anchor, this is the point that the stem of the bubble will reach outwards towards.

Finally is the bubble content, this represents the actual displayed elements that live inside of the bubble such as it's shape, the text it shows, and any other visual elements that you want to have seen when a line comes in.

This splitting of the code was done to make it easy to make your own bubble variants. Instead of having to deal with dialogue events or tracking code most of the time to make your own bubbles you can make your own bubble content subclass.

We ship one bubble content subclass called Basic Bubble Content that shows off many features and also supports customisation. It is a highly flexible bubble content subclass that supports different visual elements including nameplates, text colours, and typewriting text. This guide and the add-on examples all use the Basic Bubble Content.

Setting up for Speech Bubbles

This guide covers building out a scene using the speech bubbles from scratch, if you just want to see an already working scene in action check our provided .

To use Speech Bubbles for Yarn Spinner, you'll need to create a new Unity project and , and then .

For this guide, we'll assume you've made a simple 2D side-scrolling environment, much like this:

Our environment is nothing more than some sprites (from the GameObject menu -> 2D Object -> Sprites)—a Square, resized to be the floor, and two capsules—and a simple player movement script.

Creating a Dialogue Runner

Add an empty GameObject to your Hierarchy, and name it Dialogue System. Use the Add Component button in the Inspector to add a Dialogue Runner component and an In Memory Variable Storage component to it and add the In Memory Variable Storage into the Variable Storage slot in the inspector:

Then, in the Hierarchy, add a Canvas as a child object, as well as a new empty GameObject named Bubble View. Select the Bubble View and use the Add Component button in its Inspector to add a Bubble Dialogue View component:

Next, make a new Yarn project in the Assets pane, give it a Yarn Script, and add the new project to the Dialogue Runner in the Inspector.

Our demonstration here uses the following .yarn script:

Simple Yarn Script
title: Start
---
Orange: Hello!
    -> Hi!
        Orange: Hello.
    -> Who are you?
        Orange: I'm Orange.
    -> You're orange.
        Orange: Yep.
===

Make sure the Start Node in the Dialogue System's Inspector is set to Start, and that Start Automatically is chosen.

Next, expand the Dialogue Presenters section of the Dialogue System's Inspector, set the number of Dialogue Presenters to 1, and drag the BubbleView GameObject from the Hierarchy (it should be a child of the Dialogue System) into the slot:

Adding Bubbles to Characters

Our simple 2D side-scrolling environment has two characters in it: a Player Character, and a Orange NPC. In this case, we want things that the player can choose from to come out of bubbles attached to the Player Character, and we want the NPCs responses to come out of the NPC.

To allow this to happen, we must specify the position that the bubbles will be anchored to, for each character. To do this for the Orange NPC, select them in the Hierarchy, and add an empty GameObject as a child. Name it Bubble Anchor:

Select the BubbleAnchor in the Hierarchy, and position it above the character, wherever you want the bubble to be anchored:

Evry character will need an anchor otherwise the speech bubbles won't know where to position the bubble when it comes time for that character to speak. This is the case even if the character won't be moving anywhere.

Next, create a new Basic Character Bubble Data asset, in the Project pane:

Name the new asset Bubble Data. The Bubble Data is how we support customisation of the Basic Bubble Content. While we could add in a variety of configurations in this case we will go with just having a white background, no nameplate, and black text. Select the Bubble Data asset, and use the Inspector to set the Text Color to black. Then, select the Character in the Hierarchy and use its Inspector's Add Component button to add a Character Bubble Anchor component:

Use the Inspector on the Orange NPC to set the Character Name (ours is called "Orange"), drag the Bubble Anchor child object from Hierarchy to the Bubble Position slot, and drag the Bubble Data asset from the Project pane to the Character Bubble Data slot:

Now when Orange says a line the character anchor will let the bubble dialogue view know that the Bubble Data should be used for that character and shown at this position.

Add a Bubble Anchor child object to the Player Character as well, and position it appropriately. Then, use the Add Component button in the Player Character's Inspector to add three components: a Character Bubble Anchor component, a Sample Bubble Option Input component, and a Player Input component.

Set the Character Name to something appropriate (in the case of the Player Character, "Player" is a good idea), assign the Player Character's Bubble Anchor to the Bubble Position slot, and assign the same Bubble Data asset you used for the Orange NPC to the Character Bubble Data slot:

In this case we are using the same configuration data for both the player and the NPC, but if you wanted them to look different you could make a new Basic Bubble Content data for the player.

Expand the new asset in the Project pane so you can see the specific action that you just made:

In the Sample Bubble Option Input component, assign the Advance Dialogue action to the Advance Dialogue Action slot (by dragging it from the expanded Input Actions Asset in the Project pane), and drag the Bubble View from the Dialogue System (in the Hiearachy) into the Bubble Dialogue View slot:

The Sample Bubble Option Input script comes with Speech Bubbles for Yarn Spinner. You can find it inSpeech Bubbles for Yarn Spinner/Examples/Shared Example Resources. The script gives you basic input handling to allow the player to select and change options for their dialogue. It's not intended to be used or even subclassed, and is solely provided for samples and examples. In a game, your game's input system should handle this but this shows off a starting point for integrating this functionality into your games input system.

In the Player Input component, drag the overall Dialogue Actions asset from the Project pane into the Actions slot, and drag your camera from the Hierarchy into the Camera slot, and set the Behavior dropdown to Invoke C Sharp Events:

The Player Input component needs to have its behavior setting changed to Invoke C Sharp Events because Yarn Spinner uses C# Events, rather than Unity's own event system.

Playing with Bubbles

With that, you can play your project and see the Speech Bubbles in action:

With a project ready, , and install TextMesh Pro (TMP) if prompted. You'll also need to install the Unity Input System Package.

You can find the Unity Input System Package in the Unity Package Manager, found in the Window menu -> Package Manager. For further guidance, visit .

To allow the input to be controlled by the player, create an , name it Dialogue Actions, and double-click it to bring up Action Editor. Use the Action Editor to create an Action Map for Dialogue, and then add an Action called ActionDialogue, and bind it to something appropriate (such as the Space key):

You can learn more about Input Actions .

The Player Input component is part of Unity's Input System. You can learn more about it .

Next check our provided .

install the Speech Bubbles for Yarn Spinner package
the Unity documentation
Input Actions Asset
in the Unity documentation
in the Unity documentation
Speech Bubble Examples
Speech Bubble Examples
install the Yarn Spinner package
install the Speech Bubbles for Yarn Spinner package