Trigger Chat by bowing in VR
Trigger Chat by bowing in VR
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
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
Re: Trigger Chat by bowing in VR
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.
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.
Re: Trigger Chat by bowing in VR
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?
Re: Trigger Chat by bowing in VR
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.
For Unity UI, just follow the setup instructions in the Easy Controller Section link I provided.
- focusonfungames
- Posts: 17
- Joined: Thu Jun 07, 2018 10:21 pm
Re: Trigger Chat by bowing in VR
Does the Proximity Selector component get put onto the player game object?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.
Re: Trigger Chat by bowing in VR
Yes, or a child GameObject. If it's on a child, assign the main player GameObject to the Actor Transform field.focusonfungames wrote: ↑Sun Sep 09, 2018 6:26 pmDoes the Proximity Selector component get put onto the player game object?
Then either the Proximity Selector or the Usables need trigger colliders. In the example below, the NPC has the trigger collider:
But you can do either way. In the tutorial, the player has the trigger collider.
- focusonfungames
- Posts: 17
- Joined: Thu Jun 07, 2018 10:21 pm
Re: Trigger Chat by bowing in VR
I missed the part about the player needing a Trigger Collider. Once I did that, it started to work Thanks, Tony!
Re: Trigger Chat by bowing in VR
Glad to help!
- focusonfungames
- Posts: 17
- Joined: Thu Jun 07, 2018 10:21 pm
Re: Trigger Chat by bowing in VR
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:
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.
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 ();
Thank-you.
Re: Trigger Chat by bowing in VR
Is the NPC's Usable component enabled?
How are you doing this part?
I'm finishing work for the day, but I'll be back online first thing in the morning.
How are you doing this part?
Have you hooked into the Proximity Selector's SelectedUsableObject(Usable) C# event or the OnSelectedUsable() UnityEvent?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.
I'm finishing work for the day, but I'll be back online first thing in the morning.