Dialogue System - Freezing Movement

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Jmattarock
Posts: 5
Joined: Tue Apr 07, 2020 5:45 pm

Dialogue System - Freezing Movement

Post by Jmattarock »

Hi Guys!

So I followed along In the documents and I can't seem to get this working. I am trying to lock player movement and Camera on conversation start and re-enable mouse cursor so the player can select conversation options. Once conversation is over lock mouse again and give back controls to player.

not sure what i am doing wrong I am running 2.2.5 and this was also the output i got from the debug.

Dialogue System: Starting conversation 'New Conversation 1', actor=Player_convo (UnityEngine.Transform), conversant=Character_Alien_Male_01 (1) (UnityEngine.Transform).
Attachments
Inspector1.png
Inspector1.png (80.14 KiB) Viewed 349 times
Inspector.png
Inspector.png (77.55 KiB) Viewed 349 times
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System - Freezing Movement

Post by Tony Li »

Hi,

Thanks for posting this line:

Dialogue System: Starting conversation 'New Conversation 1', actor=Player_convo (UnityEngine.Transform), conversant=Character_Alien_Male_01 (1) (UnityEngine.Transform)

The OnConversationStart event will only be send to Player_convo and Character_Alien_Male_01 (1).

You need the event to be sent to Character_Cyberpunk_Male_01, which is the GameObject that has the Dialogue System Events component.

One way to do this is to assign Character_Cyberpunk_Male_01 to the Dialogue System Trigger's Conversation Actor field.

Another way is to add a Dialogue Actor component to Character_Cyberpunk_Male_01 and select your player actor from the dropdown. (The player actor is called "Player" unless you've renamed it.) This will associate Character_Cyberpunk_Male_01 with the player actor.

If that doesn't help, please let me know how you're triggering the conversation.
Jmattarock
Posts: 5
Joined: Tue Apr 07, 2020 5:45 pm

Re: Dialogue System - Freezing Movement

Post by Jmattarock »

Hi Tony,


Where is the Dialogue System Trigger's Conversation Actor field? Can't seem to find it on the component. I tried adding the Dialogue Actor component to the player and picked Player from the dropdown, that didn't work either.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System - Freezing Movement

Post by Tony Li »

Hi,

Keep the Dialogue Actor component on Character_Cyberpunk_Male_01. It won't hurt.

This is Private Hart's Dialogue System Trigger in DemoScene1:

privateHartDialogueSystemTrigger.png
privateHartDialogueSystemTrigger.png (54.3 KiB) Viewed 343 times

If you were to assign Character_Cyberpunk_Male_01 to the Conversation Actor field (circled in magenta above), Character_Cyberpunk_Male_01 would receive OnConversationStart messages.

Since the Conversation Actor field is unassigned, it follows the rules detailed here.

If you don't assign the Conversation Actor field, the Dialogue System Trigger will try to choose an appropriate GameObject:
  • If the trigger type is OnTriggerEnter/Exit or OnCollisionEnter/Exit, it will use the GameObject that collided with the trigger. So if Character_Cyberpunk_Male_01 has the collider that interacted with the Dialogue System Trigger, it would choose Character_Cyberpunk_Male_01 .
  • If the trigger type is OnUse, it will use the GameObject that sent the "OnUse" message, typically the GameObject with a Selector or Proximity Selector component. So if Character_Cyberpunk_Male_01 has the Selector component that interacted with the Dialogue System Trigger, it would choose Character_Cyberpunk_Male_01 .
  • Otherwise it will look for a GameObject that has a Dialogue Actor component whose actor dropdown matches the conversation's actor. Failing that, it will look for a GameObject whose name matches the conversation's actor.
Jmattarock
Posts: 5
Joined: Tue Apr 07, 2020 5:45 pm

Re: Dialogue System - Freezing Movement

Post by Jmattarock »

Hi,

I think i got it working the character locks on conversations and mouse re appears again. How can i lock the camera from moving when i use the mouse to interact with response?

Cheers,
Jon
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System - Freezing Movement

Post by Tony Li »

Hi Jon,

Use the same Dialogue System Events component. Assign your camera control script to it, just like you assigned the PlayerController script.
Jmattarock
Posts: 5
Joined: Tue Apr 07, 2020 5:45 pm

Re: Dialogue System - Freezing Movement

Post by Jmattarock »

Perfect that worked great!

Thank you!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System - Freezing Movement

Post by Tony Li »

Glad to help!
Post Reply