A powerful and flexible dialogue system plugin for Godot 4.x, implemented in C#.
- Easy-to-use dialogue UI system
- Support for branching dialogues with options
- Profile pictures support
- Customizable text display effects
- Full C# implementation
- Clean and modular architecture
Create these actions in Project Settings → Input Map:
interact: Start dialogue with NPCsnext_page_dialog: Advance to next dialogue pageskip_writting_body_dialog: Skip text animation
select_menu_item_dialog: Choose current optionselect_last_menu_item_dialog: Choose last optionui_up: Navigate options upwardui_down: Navigate options downward
- Add
DialogRayCast2DorDialogRayCast3Dto your player scene - Configure the collision mask
- Set
IsConfigurated = trueto remove warnings - Implement the interaction input:
public override void _Input(InputEvent @event)
{
if (Input.IsActionJustPressed("interact"))
dialogRayCast2D.Interact();
}- Add
DialogArea2DorDialogArea3Dto your NPC scene - Connect to the dialogue system:
public override void _Ready()
{
DialogArea.DialogueStarted += DialogueStarted;
}
private DialogPageWithOptions DialogPage { get; set; } = new DialogPageWithOptions()
{
Title = "NPC Name",
Body = "What would you like to know?",
Profile = ResourceLoader.Load<Texture2D>("path_to_profile"),
Options = new[]
{
new DialogMenuOptions()
{
Text = "Tell me about yourself"
},
new DialogMenuOptions()
{
Text = "Show me your wares",
NextPage = new DialogPageWithNextPage()
{
Title = "NPC Name",
Body = "Here's what I have in stock..."
}
}
}
};
private async void DialogueStarted(Node entity)
{
await DialogUI.Instance.ShowDialogAsync(DialogPage);
}- Open the sample scene:
res://addons/dialog_sharp/sample/DialogSharpSample.tscn - Play the scene to understand the basic workflow
- Use it as a template for your own dialogues
- Dialogues can be stored as resource files for better organization
- Use branching dialogues to create complex conversation trees
- Customize the UI theme to match your game's style
If you appreciate our work, don't forget to give us a star on GitHub! ⭐
