# Meet and Talk

1. Follow the documentation of the plugin to create the first dialogue.

{% embed url="<https://blyattukan.github.io/meet-and-talk-documentation/>" %}

2. Go to **Meet and Talk -> Example** folder and drag the **Meet And Talk** prefab into the scene.
3. Create a new script called **UHFPSDialogueLocker.cs** that will handle player locking during dialogue.

```csharp
using UHFPS.Runtime;
using UnityEngine;

namespace UHFPS.Integrations.MeetAndTalk
{
    public class UHFPSDialogueLocker : MonoBehaviour
    {
        private GameManager gameManager;

        private void Awake()
        {
            gameManager = GameManager.Instance;
        }

        public void LockPlayerForDialogue()
        {
            gameManager.FreezePlayer(true, true);
            gameManager.DisableAllGamePanels();
        }

        public void UnlockPlayerForDialogue()
        {
            gameManager.FreezePlayer(false, false);
            gameManager.ShowPanel(GameManager.PanelType.MainPanel);
        }
    }
}
```

3. Add **UHFPSDialogueLocker** to the **Meet and Talk -> Dialogue Manager** prefab and set the **Dialogue Manager** dialogue events to **LockPlayerForDialogue()** and **UnlockPlayerForDialogue()**.

<figure><img src="https://2665493337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh8bp6Jx5qkS4c0NEaWR1%2Fuploads%2FP3DFzH1GGBmBb0XCk1nb%2FScreenshot_5.png?alt=media&#x26;token=9b267888-9bbe-498d-bed2-aea5db4fff33" alt=""><figcaption></figcaption></figure>

3. Create a new script called **UHFPSDialogueStarter.cs** that will be used to start the dialogue.

```csharp
using UnityEngine;
using MEET_AND_TALK;
using UHFPS.Runtime;

namespace UHFPS.Integrations.MeetAndTalk
{
    public class UHFPSDialogueStarter : MonoBehaviour, IInteractStart
    {
        public DialogueContainerSO dialogueContainer;

        public void InteractStart()
        {
            DialogueManager.Instance.StartDialogue(dialogueContainer);
        }
    }
}
```

4. In your NPC, set the layer to **Interact**, which will allow you to interact with the NPC. Additionally, add the **UHFPSDialogueStarter** component to it.
5. Assign the dialogue asset to the **Dialogue Container** field.

<figure><img src="https://2665493337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh8bp6Jx5qkS4c0NEaWR1%2Fuploads%2FC4qbuFGLsNU7bxTnjxCp%2FScreenshot_6.png?alt=media&#x26;token=19e70b9a-4db0-4e21-9a91-8958e8a78970" alt=""><figcaption></figcaption></figure>

Unity Asset Store link to the **Meet and Talk** asset page:

{% embed url="<https://assetstore.unity.com/packages/tools/visual-scripting/meet-and-talk-dialogue-system-free-version-245191>" %}

*Guide created by: Ravl & TW (Patrick)*
