I need some help with the crosshair and scene / object understanding. The doc here doesn’t help much:
Is in the sample scenes an area where this feature is explained in detail?
Thanks
I need some help with the crosshair and scene / object understanding. The doc here doesn’t help much:
Is in the sample scenes an area where this feature is explained in detail?
Thanks
Hello @info_AM,
Could you provide more details about the issue you’re experiencing? The more information you share, the better we can assist you!
For me it’s not obvious how this feature works and what I can do with it. So I need a complete tutorial what this is all about.
In the “Convai Demo - All Features” demo I talked to Missy and looked at the tower object. “I asked what is this?”
In my meta Quest MR project I want to have a system where the user can ask “What is this?” when looking at objects I want to be able to interact. I want to implement a system where:
How do I have an interactable object and raycast with convai? Is there something “out of the box” or do I need to create everything myself (which I can with tutorials). Just asking if you already have it working and I just can’t find an example.
Thanks
Missy is a demo character for Narrative Design and doesn’t include any scripts related to Actions.
To achieve the functionality you described, follow these steps:
Assets/Convai/Prefabs/Utils/Dynamic Move Target Indicator.prefab
into your scene, then reference it in the appropriate field in Interactables Data.These are the basic requirements.
Next, add an object to your scene (e.g., a Cube) with a Collider.
After this setup, when the Crosshair is over the object and you ask the NPC about it, the NPC will be able to identify it.
Additionally, without adding any specific objects, if you look at a floor or ground in your scene and ask the NPC something like “Can you move there?”, the NPC will be able to navigate to that location.
If you need further assistance, feel free to ask.
Wow, ok. That seems quite what I want. Nice to see that this is working.
“Only” thing missing is the “controller or gaze” logic. But I guess I have to do that on my own…
What you describe will always take the center of screen (crosshair) to check what is hit, right?
Exactly!
To customize the logic for “controller or gaze,” you just need to modify one part of the code. In ConvaiCrosshairHandler.cs, look for the FindPlayerReferenceObject method.
Specifically, update this line:
if (Physics.Raycast(_camera.ViewportPointToRay(centerOfScreen), out RaycastHit hit))
This currently casts a ray to the center of the screen. You can adjust this to fit your needs, such as using the controller’s raycast or checking where the player’s gaze is pointing.
With this update, you can define how to detect the object based on your preferred input method.
If you need more help, feel free to ask!