HTC Vive Raycast

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
focusonfungames
Posts: 17
Joined: Thu Jun 07, 2018 10:21 pm

HTC Vive Raycast

Post by focusonfungames »

Hi Tony & Team

Is there any way to enable a visual raycast from the dialogue system so I know where it's aiming? I'm running into a case where the Usable icon ("press spacebar to talk to this NPC") is only appearing when I look near it's head but off to the side a bit...

Second: I can't seem to customize the Usable icon. I've followed what I found on the forums in creating a Basic Standard Usable UI 1 game object and placed it as a child of my NPC but it doesn't show up in my headset. I only see the default one on my screen/monitor. I want to see it in world space so that I can see it in my VR headset.
Attachments
usable.png
usable.png (3.81 KiB) Viewed 460 times
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: HTC Vive Raycast

Post by Tony Li »

Hi,
focusonfungames wrote: Fri Sep 07, 2018 8:50 pmIs there any way to enable a visual raycast from the dialogue system so I know where it's aiming? I'm running into a case where the Usable icon ("press spacebar to talk to this NPC") is only appearing when I look near it's head but off to the side a bit...
It isn't built in. But you can write a script to do it, or add a line-shaped GameObject as a child of the camera. If you only want it to appear when a Usable is targeted, you can hook into the OnSelectedUsable() and OnDeselectedUsable() events. There are also corresponding SelectedUsableObject and DeselectedUsableObject C# events if you want to do it in code without using UnityEvents.
focusonfungames wrote: Fri Sep 07, 2018 8:50 pmSecond: I can't seem to customize the Usable icon. I've followed what I found on the forums in creating a Basic Standard Usable UI 1 game object and placed it as a child of my NPC but it doesn't show up in my headset. I only see the default one on my screen/monitor. I want to see it in world space so that I can see it in my VR headset.
The Standard Usable UI is in world space. Here's an example where I've added the Basic Standard Usable UI prefab to an NPC:

Image

Is yours positioned correctly for your NPC? Maybe it's offset really far from the NPC.
Post Reply