Create a Dialogue System with Branching Choices - Top Down Unity 2D #22

Опубликовано: 04 Май 2026
на канале: Game Code Library
11,491
309

Let's get replying to our NPCs with dialogue options and branches these responses into conversations! So when our NPC asks a question, a Dialogue Box will open with response options for us to reply with!
Previous NPC Video:    • Add NPC and Dialogue System to your Game -...  
We'll be building from our previous NPC tutorial - and tidying up a bit of that code by adding in a Dialogue Controller.

You can follow the playlist 🐸 to this top down base template!
Full Playlist:    • Top Down Tutorial Series - Unity 2D  

Get the code:   / interactive-with-125570170  
Download the Top Down Template🐸: https://gamecodelibrary.itch.io/top-d...

Sprite sheet: https://pixel-boy.itch.io/ninja-adven...

All source code for all videos I have made and will make in the future can be found on my Patreon:
  / gamecodelibrary  

Be sure to subscribe to see what kind of adventure we can go on together! I'm excited! :-)

If you have any suggestions, feedback or questions, be sure to comment below! Any opinions will help me out on this journey ♡

Check out the full platformer playlist!
   • FULL Platformer Tutorial Series - Unity 2D  

BUY THE COMPLETE PLATFORMER GAME TEMPLATE NOW!!!
https://gamecodelibrary.itch.io/2d-pl...
  / shop  

#unity #gamedev #gamedevelopment #unity2d #topdown

0:00 - Intro
0:28 - DialogueController UI Change
1:02 - DialogueController Script
2:53 - Amend NPC Script
4:35 - DialogueController Setup
4:56 - Dialogue Choice Class
5:50 - Dialogue Choices Setup
7:04 - Broken Example Test
7:42 - Add EndDialogueLines
8:00 - EndDialogueLines Setup
9:10 - Choices UI
11:06 - Add Choices to DialogueController
13:08 - MAIN Choices Code to NPC Script
17:27 - Check Dialogue ScriptableObject
18:08 - Old Man Test
18:38 - Multi Questions Example
20:33 - Multi Questions Test
21:04 - Next Video
21:24 - Get the Code
21:43 - Outro