Page 1 of 1
Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 12:15 pm
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).
Re: Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 12:29 pm
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.
Re: Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 12:51 pm
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.
Re: Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 2:25 pm
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 (54.3 KiB) Viewed 347 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.
Re: Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 6:01 pm
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
Re: Dialogue System - Freezing Movement
Posted: Sat Apr 25, 2020 7:47 pm
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.
Re: Dialogue System - Freezing Movement
Posted: Sun Apr 26, 2020 12:30 am
by Jmattarock
Perfect that worked great!
Thank you!
Re: Dialogue System - Freezing Movement
Posted: Sun Apr 26, 2020 7:49 am
by Tony Li
Glad to help!