TextMesh Pro Autoscroll Setup
To set up autoscroll for TextMesh Pro, tick the typewriter effect's Auto Scroll Settings > Auto Scroll Enabled checkbox.
Unity UI Text Autoscroll Setup
To set up autoscroll for Unity UI Text:
- Start with a dialogue UI that uses a scroll rect, such as WRPG Template Standard Dialogue UI, or create a new dialogue UI that uses a scroll rect.
- Create a copy of the Subtitle Text GameObject.
- Name it "Sizer Text".
- Move it to be the first child of Scroll Content.
- Move Subtitle Text to be a child of Sizer Text.
- Remove Sizer Text's typewriter effect.
- Set the Pivot to X=0, Y=1.
- Set the Text component's Alignment to Left Top.
- Inspect the Scroll Rect GameObject. Make sure it has a UI Scrollbar Enabler component. Assign the fields Scroll Rect, Scroll Content, and Scrollbar.
Inspect Subtitle Text.
- Set the Rect Transform anchor to Horizontal Stretch Top. Set the Pivot to X=0, Y=1. Set Pos Y=0.
- Set the Text component's Alignment to Left Top. The Text settings should be the same as Sizer Text.
- Inspect the Unity UI Typerwriter Effect component. Expand Auto Scroll Settings. Tick Auto Scroll Enabled. Assign the Scroll Rect GameObject to the fields Scroll Rect and Scrollbar Enabler. Assign the Sizer Text GameObject to Sizer Text.
- If the OnCharacter() event is assigned ScrollRect.verticalNormalizedPosition, delete it.
- Add a Layout Element to Subtitle Text and tick Ignore Layout. This allows the scroll rect's content to size itself based on Sizer Text.
- Inspect Scroll Content.
- Add a Vertical Layout Group if one doesn't exist. Set Child Alignment to Upper Left. Tick Control Child Size Width & Height and optionally Child Force Expand Width. If you don't tick Child Force Expand Width, make sure the Subtitle Text's width spans across the Scroll Content's full width. Untick the other checkboxes.
- Add a Content Size Fitter if it doesn't exist. Set Vertical Fit to Preferred Size.
<< Dialogue UIs