Trigger Chat by bowing in VR

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SuperSal
Posts: 26
Joined: Tue Jul 03, 2018 6:43 am

Trigger Chat by bowing in VR

Post by SuperSal »

So I'm getting to the point where I will set up characters and the Dialogue System in VR. A month ago, I asked to create a chat if you remember when I asked how can I set up Skyrim, Fallout, Dishonored style chat system in Unity. So yeah,its related to that and since its a VR project I was thinking to add some interactivity. I was wondering if you can tell me how can I trigger a chat when I bow before the character to trigger chat..


Also when I will set up the question how will chose question that needs to answer, will I use Oculus Rift's touch controls to point towards the question or will scroll down from the list?


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

Re: Trigger Chat by bowing in VR

Post by Tony Li »

Hi,

Detecting the player's bow motion is outside the scope of the Dialogue System. Maybe you could use an asset such as AIRSIG's 3D Motion Gesture Recognition.

Once you've detected the bow, you can call the nearest Dialogue System Trigger's OnUse() method to start the conversation. One way to know the nearest Dialogue System Trigger is to use the Dialogue System's Proximity Selector component. Instead of "using" the selection with an input button, you'll use it by detecting the bow.

Remember that the dialogue UI uses standard Unity UI. You just need to set up your project to use Oculus Touch with Unity UI. It's not specific to the Dialogue System. You can find instructions on Oculus's site: Easy Controller Selection.
SuperSal
Posts: 26
Joined: Tue Jul 03, 2018 6:43 am

Re: Trigger Chat by bowing in VR

Post by SuperSal »

Since, time is short for me and my project is due within few days. Could you show me how can do that with the suggested VR assets?
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Chat by bowing in VR

Post by Tony Li »

I've never used 3D Motion Gesture Recognition. I'm just trying to help point you to resources that can help you with things that are outside the Dialogue System's scope, such as recognizing VR gestures.

For Unity UI, just follow the setup instructions in the Easy Controller Section link I provided.
User avatar
focusonfungames
Posts: 17
Joined: Thu Jun 07, 2018 10:21 pm

Re: Trigger Chat by bowing in VR

Post by focusonfungames »

Tony Li wrote: Sun Aug 19, 2018 1:40 am Once you've detected the bow, you can call the nearest Dialogue System Trigger's OnUse() method to start the conversation. One way to know the nearest Dialogue System Trigger is to use the Dialogue System's Proximity Selector component. Instead of "using" the selection with an input button, you'll use it by detecting the bow.
Does the Proximity Selector component get put onto the player game object?
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Chat by bowing in VR

Post by Tony Li »

focusonfungames wrote: Sun Sep 09, 2018 6:26 pmDoes the Proximity Selector component get put onto the player game object?
Yes, or a child GameObject. If it's on a child, assign the main player GameObject to the Actor Transform field.

Then either the Proximity Selector or the Usables need trigger colliders. In the example below, the NPC has the trigger collider:

Image

But you can do either way. In the tutorial, the player has the trigger collider.
User avatar
focusonfungames
Posts: 17
Joined: Thu Jun 07, 2018 10:21 pm

Re: Trigger Chat by bowing in VR

Post by focusonfungames »

I missed the part about the player needing a Trigger Collider. Once I did that, it started to work :) Thanks, Tony!
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Chat by bowing in VR

Post by Tony Li »

Glad to help!
User avatar
focusonfungames
Posts: 17
Joined: Thu Jun 07, 2018 10:21 pm

Re: Trigger Chat by bowing in VR

Post by focusonfungames »

Sorry to necropost, but this is relevant to this discussion as I'm trying to fire "use" on my NPC dialogue in the same manner that the GP mentioned, except that mine is via a different gesture.

I have the gesture working, I have a Debug.Log firing to tell me when my Proximity Selector enters the NPC's dialogue manager and also when it exits. In my code, when my gesture is detected, I do:

Code: Select all

Debug.Log (proximitySelector.CurrentUsable);
proximitySelector.UseCurrentSelection ();
Unfortunately, I get a null in my log for the CurrentUsable and, of course, the conversation does not start. If my Proximity Selector comes into contact with a Usable, should it not become the CurrentUsable?

Thank-you.
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Chat by bowing in VR

Post by Tony Li »

Is the NPC's Usable component enabled?

How are you doing this part?
focusonfungames wrote: Mon Nov 05, 2018 9:44 pmI have a Debug.Log firing to tell me when my Proximity Selector enters the NPC's dialogue manager and also when it exits.
Have you hooked into the Proximity Selector's SelectedUsableObject(Usable) C# event or the OnSelectedUsable() UnityEvent?

I'm finishing work for the day, but I'll be back online first thing in the morning.
Post Reply