new input system + 3rd person controller best practices

Announcements, support questions, and discussion for the Dialogue System.
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

new input system + 3rd person controller best practices

Post by mcfurgerburger »

Hello, this thread is probably gonna be answered by Tony (lol), but I've started a fresh new project after multiple learning ones and currently have the following installed:

- dialogue system
- TMP
- new input system
- Starter Asset third person controller (this seems to be the best free asset that's usable w/ new input system)

I set up the standard back and interact buttons and they work great. But I noticed a weird quirk when using a gamepad button for interact (which I mapped to the use button and submit in order to start conversations with it). In that it'll go through the conversation and as soon as it ends, it'll restart the conversation because the button kept firing despite not being pressed again to trigger the conversation.

I had to write a script as a workaround that disables the dialogue system trigger and waits for 1 second before re-enabling it, but it feels like I shouldn't have to resort to something like that.

The other issue I faced was that my character would still be movable during conversation despite disabling the character controller, third person controller, etc, basically everything related to movement. The only way I could disable movement was by checking Pause Game During Conversation in the dialogue system trigger, but this is not ideal because I would like to have facial animations at some point. I saw an earlier thread from years ago about this topic but I think the dialogue system has evolved enough that that particular thread is no longer valid. At the very least I couldn't make heads or tails of it.

Anyway, would love to know what the best practices for these two scenarios are, so I don't have to rely on the less than ideal workarounds.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: new input system + 3rd person controller best practices

Post by Tony Li »

Hi,

I'll check out the third person starter controller asset today and reply back. The configuration steps to stop it during conversations are probably similar to: How to: Configure Standard Assets First Person Controller

One thing it doesn't do is to prevent restarts on the same frame as when a conversation ended. Since interaction can be handled so many different ways in different games, the Dialogue System doesn't make a lot of assumptions about when you want to start a conversation. That said, I've added a checkbox to the upcoming version 2.2.28 that you can tick to prevent a Dialogue System Trigger from triggering a conversation on the same frame in which a conversation just ended. That will probably handle what you want.
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

Re: new input system + 3rd person controller best practices

Post by mcfurgerburger »

Sounds great! Looking forward to what you find w/ the third person controller.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: new input system + 3rd person controller best practices

Post by Tony Li »

I just posted an example scene in How to: Configure Standard Assets First Person Controller thread. A GameObject named ---SETUP--- explains how it's set up.
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

Re: new input system + 3rd person controller best practices

Post by mcfurgerburger »

Dialogue System Events is not disabling scripts in my player object. So despite using the exact same settings as the example, it's not working. Could this be because I instantiate my player?

Edit: I made a simple test by having one of the conversation start events simply call a script function that Debug.Logs some text to the console. It doesn't run. So dialogue system events are just not working on my instantiated player object. :(

Edit 2: I noticed that during runtime, if I drag the instantiated player object into the conversation actor/conversant fields of the NPC's dialogue system trigger then it sort of works. But that obviously isn't a solution.

Any chance I can send you my project so you can take a look?
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: new input system + 3rd person controller best practices

Post by Tony Li »

Hi,

Dialogue System Events will only run on the Dialogue Manager and the GameObjects that the Dialogue System has determined to use as the conversation actor and conversant. This manual section explains the rules by which it determines the GameObjects: Character GameObject Assignments

If that doesn't fix it, please feel free to send a reproduction project to tony (at) pixelcrushers.com
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

Re: new input system + 3rd person controller best practices

Post by mcfurgerburger »

I did read that page and tried assigning the gameobjects to the trigger but perhaps I did not do it correctly. I have sent an email w/ my project.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: new input system + 3rd person controller best practices

Post by Tony Li »

Thanks for sending the repro project.

On your NPC's Dialogue System Trigger, the Conversation Actor field points to the player prefab asset. Instead, you want the Conversation Actor to use the player instance in the scene. The easiest way to do this is to simply unassign the Conversation Actor field. When a Dialogue System Trigger is set to OnUse (or OnTriggerEnter), if Conversation Actor is unassigned it will use the GameObject that triggered it (i.e., the player instance with the Proximity Selector component).
User avatar
WaWa
Posts: 16
Joined: Tue May 21, 2024 6:03 am

Re: new input system + 3rd person controller best practices

Post by WaWa »

Hi Tony,
Sorry for bump the old post
this is exactly what I am looking.
I want to use gamepad, for interact NPC dialogue (other than E keyboard).
note: I am not using Rewired or anything. I using starter asset TPC too. I using Dualshock PS4

I following what you wrote at gameobject --SETUP--
It's worked. but it seems Actor jumps when starting a conversation. I followed by values lower than -100 just like this image
Image
but It's not worked. I also tried -90 too. my Actor and Your Robot still jumps when starting a conversation

1. How we solve?
2. oh and Define a separate Input action, what does this mean? does mean create an new list of input action in Starter Asset's Input Action?

3. I am looking forward about how to use button's gamepad for continue dialogue too
with Note that I am using key E and mouse click (any screen) and LivelyChatBubble prefab. really appreaciate if its not bother you.

Thank you and have a nice day!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: new input system + 3rd person controller best practices

Post by Tony Li »

Hi,

Have you configured your player as described in How To: Configure Starter Assets First/Third Person Controller? You may not need to define a new input action. It may also help to watch the Interaction video tutorial.

Tick the Dialogue Manager's Input Device Manager component > Always Auto Focus checkbox. This will help you navigate response menu items and click continue buttons with the gamepad.
Post Reply