Page 1 of 1
Trigger Chat by bowing in VR
Posted: Sun Aug 19, 2018 12:37 am
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
Re: Trigger Chat by bowing in VR
Posted: Sun Aug 19, 2018 1:40 am
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.
Re: Trigger Chat by bowing in VR
Posted: Sun Aug 19, 2018 4:21 am
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?
Re: Trigger Chat by bowing in VR
Posted: Sun Aug 19, 2018 10:05 am
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.
Re: Trigger Chat by bowing in VR
Posted: Sun Sep 09, 2018 6:26 pm
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?
Re: Trigger Chat by bowing in VR
Posted: Sun Sep 09, 2018 6:46 pm
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:
But you can do either way. In the
tutorial, the player has the trigger collider.
Re: Trigger Chat by bowing in VR
Posted: Sun Sep 23, 2018 2:34 pm
by focusonfungames
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
Posted: Sun Sep 23, 2018 3:09 pm
by Tony Li
Glad to help!
Re: Trigger Chat by bowing in VR
Posted: Mon Nov 05, 2018 9:44 pm
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.
Re: Trigger Chat by bowing in VR
Posted: Mon Nov 05, 2018 10:04 pm
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.