Usable issues... I think

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
grofit
Posts: 13
Joined: Sun Feb 07, 2016 2:47 pm

Usable issues... I think

Post by grofit »

Hey,

So I am getting around to prototyping a dialogue heavy game and I thought I would do a bare bones starter to see how it all functions.

Now I followed your quick start video as well as the documentation but for the life of me I cannot get the player being able to use an NPC.

My process was:

- Make a new scene
- Add a cube call it player
- Add a sphere call it NPC
- Create dialogue DB
- Run the Dialogue Manager wizard (same settings as in the tutorial vids)
- Create NPC Actor (player already exists)
- Create a dummy conversation between 2 actors
- Run NPC wizard and add the usable component and select the dialogue etc
- Run Player wizard and just leave controller as custom

So now I was expecting when I move the Player (cube) within 5 units of the NPC (sphere) it would show some sort of option for me to interact as the demo scenes do and the videos do. So I am just wondering if there is anything I am missing here as a basic bare bones setup to just get an initial dialogue initiated via a use?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable issues... I think

Post by Tony Li »

Hi,

You probably need to add a rigidbody to the player or NPC. The wizards try to do as much as possible, and although they provide some basic scripts such as SimpleController but they don't presume to enforce a specific way to configure your player physics and controls.

If I understand your steps correctly, your NPC should already have these components:
  • Transform, Sphere, Sphere Collider, Mesh Renderer.
  • Conversation Trigger set to OnUse.
  • Another Sphere Collider with Is Trigger ticked and Radius set to the distance at which you want the player to be able to converse.
  • Usable.
Your Player should already have these components:
  • Transform, Cube, Box Collider, Mesh Renderer.
  • Proximity Selector.
  • (Maybe a Set Component Enabled On Dialogue Event to disable Proximity Selector during conversations.)
Proximity Selector depends on Unity sending an OnTriggerEnter message. If the setup above matches your scene, add a Rigidbody to one of the GameObjects (e.g., Player) to allow Unity to register collisions and triggers.

If this doesn't help, please let me know. Also feel free to send an example scene to tony (at) pixelcrushers.com. I'll be happy to take a look.
grofit
Posts: 13
Joined: Sun Feb 07, 2016 2:47 pm

Re: Usable issues... I think

Post by grofit »

Hello!

Right yes the problem was the NPC did not have a 2nd sphere collider on it, so that is good to know.

One other thing that I have noticed is that I do not see any sort of GUI indication at the top "spacebar to interact" etc, and I have a proximity selector script on the player which seems setup normally, the only thing is I am not sure what to put in Gui Skin and Gui Style Name. I have tried putting the wheel gui in there and some of the others and I had no luck but I couldnt find any docs specifically around this area. The dialogue triggers ok so its definitely active.

Again sorry for the simplistic questions I just want to get the bare bones working in isolation before I move on.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable issues... I think

Post by Tony Li »

No worries! It's really smart of you to make sure all your tech is in place before moving on to content.

You can leave the Proximity Selector's Gui Skin field unassigned. In this case it will use Unity's default GUI Skin. If you do assign a GUI Skin, you can use the Gui Style Name field to specify which GUI Style to use in the skin. Otherwise it will use the default "label" style.

The Topdown Demo in Assets/Dialogue System/Examples/Feature Demo/Topdown Demo uses a Proximity Selector. You can check it for any differences from your scene. (Or feel free to send me an example of your setup.)

Here are some documentation links:
Maybe your Proximity Selector isn't finding the style named in Gui Style Name in the skin assigned to Gui Skin.

Another possible issue is if you're using Unity UI. Proximity Selector uses legacy Unity GUI by default. (Some developers still haven't moved to using Unity UI.) You can tell it to use Unity UI elements by setting up a Unity UI Selector Display component. To see Unity UI in action, try out the scenes in Examples/Unity UI Examples.
grofit
Posts: 13
Joined: Sun Feb 07, 2016 2:47 pm

Re: Usable issues... I think

Post by grofit »

ah ok, will give that a go when I get back to the computer later, thanks again for the info.
Post Reply