Way to disable mouselook and keyboardmovement in conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jezevcik88
Posts: 9
Joined: Mon Nov 03, 2014 3:21 pm

Way to disable mouselook and keyboardmovement in conversation

Post by jezevcik88 »

Hello Guys,



I'm quite new to the unity and have some tough time implementing a

way to disable mouselook and keyboardmovement during conversation



Iam using Standard First Person Controloler provided in unity.



I've added Set Enabled On Dialogue Event DLL to the First Person Controller, but how can I disable it's scripts for movement / mouselook?



I guess I have to add components I want to enable/disable to the onStart/onEnd array but HOW?





Another thing I have trouble setting bark distance and also barks are displaying also when I am turned to the opposite direction from the actor that barks.



Does the bark based on distance require som big collider for area in which will actually actor barks ?



If it's covered somewhere in tutorials please let me know.



Thank you!
User avatar
Tony Li
Posts: 20769
Joined: Thu Jul 18, 2013 1:27 pm

Way to disable mouselook and keyboardmovement in conversation

Post by Tony Li »

3278 wrote: I am using Standard First Person Controloler provided in unity. I’ve added Set Enabled On Dialogue Event DLL to the First Person Controller, but how can I disable it’s scripts for movement / mouselook? I guess I have to add components I want to enable/disable to the onStart/onEnd array but HOW?


Hello! This package contains an example scene that uses the First Person Controller. Here's how I set it up:



1. Click on your player. You should see Set Enabled On Dialogue Event or Set Component Enabled On Dialogue Event in the Inspector view. (Either one is fine. The only difference is that Set Component Enabled On Dialogue Event allows you to also assign non-MonoBehaviour components such as MeshRenderer.)



2. Set the Trigger property to OnConversation.



3. Expand the OnStart and OnEnd sections. Set their counts to 4. This will create four elements in each section.



4. In OnStart, set all of the elements' Value properties to False. From the same Inspector view, drag the MouseLook, FPSWalker, and Character Motor components into the first three elements. (I'm out of the office and going on memory; FPSWalker might be named something different.) We'll get to the fourth element in a bit.



5. Add the same components to the OnEnd section, but leave Value set as True.



6. Click the padlock icon in the upper right of the Inspector view. This locks the view on this GameObject.



7. Add another Inspector view. One way is to right-click on a tab and select Inspector. Expand the First Person Controller and click on the Camera GameObject. Drag the Camera's MouseLook component into the fourth OnStart and OnEnd element.



8. Click the padlock icon again to unlock the view.



General info: Setting up the player







3278 wrote: Another thing I have trouble setting bark distance and also barks are displaying also when I am turned to the opposite direction from the actor that barks. Does the bark based on distance require som big collider for area in which will actually actor barks ? If it’s covered somewhere in tutorials please let me know. Thank you!


To make a character bark only when the player is nearby, add a Range Trigger. Here's an old example scene that demonstrates how it's used. A translucent sphere marks the bark range. If you're within the sphere, Sgt. Graves will bark.







If you tick Check If  Player Visible, the character will perform a raycast to the player. If it's blocked (e.g., by a wall), it won't show the bark.



If barks are showing when the camera's back is to the character, make sure you're using the latest version of the Dialogue System. If you're still seeing an issue, please let me know.










Post Reply