Dialog does not start

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

Dialog does not start

Post by dkrusenstrahle »

Hello,

I have setup Dialog manager and it works great on simple 3D cubes. I can start and run dialogs from these simple cubes. But I have real characters that I add Dialogue System Trigger and Usable components to and set them exactly as I do for the cubes (I also tried copying the exact components from the cubes). The problem is that when I put the mouse on the character it does not show the messages saying "hit space". And hitting space those not start a conversation.

Why cant I start a conversation for more complex objects than a cube?
How can I change the trigger key from space to E key (like I do for quests).
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

Re: Dialog does not start

Post by dkrusenstrahle »

I solved the selection issue by setting the charcters layer (enemies) to the selector component on the Player character. But I still need to change from Space to E key.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialog does not start

Post by Tony Li »

Hi,

To change the "use" input from Space to E, inspect your Selector component and set the Use Key to E. You can also change the Use Message to tell the player to press E.
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

Re: Dialog does not start

Post by dkrusenstrahle »

Great, where can I set other quick keys like ESC for skipping?
Also how can I speed up the fade in and out of the dialog?
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialog does not start

Post by Tony Li »

Hi,

There are two ways to skip:

1. Dialogue Manager GameObject's Display Settings > Input Settings > Cancel Subtitle Input -- which I don't recommend in most cases. Instead, use:

2. Continue button. See: How To: Continue Without UI Button
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

Re: Dialog does not start

Post by dkrusenstrahle »

Thank you!

I ended up adding this script to my text (Subtitle text field):

Code: Select all

using PixelCrushers.DialogueSystem;
using UnityEngine;

public class DialogContinueFastForward : MonoBehaviour
{
    public KeyCode[] continueKeys = new KeyCode[] { KeyCode.Space, KeyCode.Return };

    void Update()
    {
        foreach (var key in continueKeys)
        {
            if (Input.GetKeyDown(key))
            {
                FastForward();
                return;
            }
        }
    }

    void FastForward()
    {
        var typewriterEffect = GetComponent<AbstractTypewriterEffect>();
        if ((typewriterEffect != null) && typewriterEffect.isPlaying)
        {
            typewriterEffect.Stop();
        }
        else
        {
            GetComponentInParent<AbstractDialogueUI>().OnContinue();
        }
    }
}
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialog does not start

Post by Tony Li »

Thanks for sharing!
Post Reply