Page 1 of 1

Player keep moving while conversation is active

Posted: Thu Feb 23, 2017 6:16 pm
by omonoia91
Hello,

I have a problem. When i move and meanwhile i press the space button (interact button) the conversation starts but my character keeps moving straight.
I have added the scripts and the camera at the Set Enabled on Dialogue Event (Script) as you can see below. The problem is when i press for example the w button that moves forward and trigger the conversation while i hold w, character still moving but i cant control it nor the camera is follow him. I dont know what i am doing wrong!

http://imgur.com/32BgODA


video example:

https://vimeo.com/205466209

I am using the standard asset third person controller and i also tried with this one https://www.assetstore.unity3d.com/en/#!/content/28647 but i am getting the same problem!
How can i solve this? Thanks!

Re: Player keep moving while conversation is active

Posted: Thu Feb 23, 2017 8:03 pm
by Tony Li
Hi!

If you're using Unity's Standard Assets ThirdPersonController, here are the steps:

1. Add ThirdPersonUserControl to the Set Component Enabled On Dialogue Event component.

2. Add a Start Sequence On Dialogue Event component.
2a. Set the Trigger to OnConversation.
2b. Add an element to OnStart.
2c. Assign the ThirdPersonController GameObject as the element's Actor.
2d. Set the element's Sequence to:

Code: Select all

AnimatorFloat(Forward,0);
AnimatorFloat(Turn,0)
This will:

1. Turn off ThirdPersonUserControl during conversations. This prevents the user from issuing movement commands to the ThirdPersonController.

2. At the start of the conversation, set the ThirdPersonController's Animator parameters to tell the Animator to stop playing the movement animation (i.e., tell it to stop running).

Here's an example scene:

StdTPC_Example_2016-10-04.unitypackage

(You can find more context in this post.)

Re: Player keep moving while conversation is active

Posted: Thu Apr 27, 2017 6:12 pm
by Tony Li
For completeness, these are the steps for Unity's Standard Assets FPSController:

1. Optionally add an Override Actor Name component, and set the Override Name to Player. (Since the prefab is named FPSController.)

2. Optionally add a Selector or Proximity Selector if that's how you want to interact in your game.

3. Optionally add a Show Cursor On Conversation to show the cursor during conversations.

4. Add a Set Component Enabled On Dialogue Event component.
  • Set the Trigger to OnConversation.
  • Add 2 OnStart elements. Assign the FPSController's FirstPersonController and Selector/ProximitySelector components. Set them to False.
  • Add 2 OnEnd elements. Assign the same components, and set them to True.
  • If you're using RigidBodyFPSController, also assign the MainCamera child's HeadBob component to OnStart and OnEnd.