Unity Playmaker - 3rd Person UI Dialogue Box for the Game
In this Unity 3rd Person tutorial, I'll be showing setting up a base UI dialogue box for the game that any game object will be able to use. I'll set up the dialogue box, then set up global variables that the fsm will pull information from as well as a close dialogue button. Lots of info here and w
This third-person tutorial builds a reusable UI dialogue box that any game object can populate with its own text and image. The value is in making it generic, driven by global variables and global open and close transitions, so a single dialogue manager serves the whole game. It includes building a nine-sliced frame so the box can stretch without distortion.
Create a nine-sliced frame
In Photoshop make a frame graphic, four corner squares plus a center, in white so you can tint it in Unity, and export as PNG. Set its texture type to Sprite (2D and UI) and mesh type to Full Rect, then open the Sprite Editor (install the 2D Sprite package if needed) and drag the four green border handles inward so the corners stay crisp while the edges tile when stretched.
Assemble the dialogue canvas
Create a canvas named dialogue, add a UI Image with the frame sprite, anchor it bottom-center, and tint it orange to match the game. Add an inset background image, a TextMesh Pro text element with a margin and a custom font, and a dialog image on the right for whatever the player is interacting with. Clear the image and make it transparent so the box starts blank. Because creating UI made an Event System on the old input system, swap it to Input System UI Input Module.
Drive it with global variables
Add a dialog manager FSM with an Init state and two events, open dialogue and close dialog, each set as a global transition so any object can call them. On open, use Set Property to push a global dialog text variable into the TextMesh Pro text, UI Set Sprite to push a global dialog sprite into the image, and Activate Game Object to show the box. Any game object can fill those globals before sending open dialogue.
Add a close button and reverse everything
Add a close button image and bind a new player input action named close dialog to the controller's east button. In the dialog manager, use Player Input Button Events on the player with that action; on Is Pressed, take the global close transition. For closing, copy the open actions and undo each: blank the text, clear the sprite, and deactivate the dialog. Turn the dialog off by default, and you have one dialogue box the whole game can reuse.





