Stopping player's movement during conversation in click to move game

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
utopologist
Posts: 2
Joined: Mon Mar 25, 2024 3:00 pm

Stopping player's movement during conversation in click to move game

Post by utopologist »

Hi there, I'm pretty new to the whole game dev thing, but Dialogue System has been helping me a LOT in starting to put together a dream project. I'm also using Playmaker, if it's relevant to what I'll describe here.

Like the title says, the game's movement system is click to move and the game is almost entirely mouse-based. I got it set up that the conversation with an NPC begins once the player clicks on him, but the problem I'm running into is that whenever the player clicks on a choice in the dialogue tree, the character moves to the spot behind the button that the player clicked. Ideally the character will stop and then just stand there next to the NPC while they're talking.

My question is how to limit input to the dialogue UI during a conversation and then return the input to normal once it the conversation is finished.

Thanks for any advice or suggestion!
User avatar
Tony Li
Posts: 20632
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stopping player's movement during conversation in click to move game

Post by Tony Li »

Hi!

Please see 07:00 of the Interaction Tutorial. Briefly: Use a Dialogue System Events component to disable your movement script(s)/FSM(s) during conversations.

Related:
utopologist
Posts: 2
Joined: Mon Mar 25, 2024 3:00 pm

Re: Stopping player's movement during conversation in click to move game

Post by utopologist »

That was it, thank you so much for this!
User avatar
Tony Li
Posts: 20632
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stopping player's movement during conversation in click to move game

Post by Tony Li »

Happy to help!
Eldritch_Horror
Posts: 28
Joined: Sun May 28, 2023 8:30 pm

Re: Stopping player's movement during conversation in click to move game

Post by Eldritch_Horror »

Hi,
Sorry for the basic level question, but I'm doing 3D for my scene, and dont have the PixelCrusher Tutotial 2D dropdown options from the tutorial. Can you advise how I'd restrict movement in 3D with the Dialogue System?
User avatar
Tony Li
Posts: 20632
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stopping player's movement during conversation in click to move game

Post by Tony Li »

Hi,

It's the exact same principle in 3D. Configure a Dialogue System Events component on your player GameObject to disable player movement component(s) in the OnConversationStart() event, and re-enable them in OnConversationEnd().
Eldritch_Horror
Posts: 28
Joined: Sun May 28, 2023 8:30 pm

Re: Stopping player's movement during conversation in click to move game

Post by Eldritch_Horror »

The logic makes sense, but I've been looking for a comperable 'disable movement' function to attach to Conversation Start/End and I'm not sure which one to use.
Attachments
Screenshot 2024-04-20 155448.png
Screenshot 2024-04-20 155448.png (303.63 KiB) Viewed 56 times
Eldritch_Horror
Posts: 28
Joined: Sun May 28, 2023 8:30 pm

Re: Stopping player's movement during conversation in click to move game

Post by Eldritch_Horror »

Apologies for the daft question, I'm new to the processes.
User avatar
Tony Li
Posts: 20632
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stopping player's movement during conversation in click to move game

Post by Tony Li »

Hi,

I'm not sure what your Player script does, but if it controls player movement then it would probably work to select enabled:

enabled.png
enabled.png (148.65 KiB) Viewed 16 times

In OnConversationStart(), select enabled and leave the checkbox unticked, which disables the Player component.

In OnconversationEnd(), select enabled and tick the checkbox, which will re-enable the Player component when the conversation ends.

Make sure your conversation will use the player GameObject as the conversation actor or conversation conversant. (See the Character GameObject Assignments link from above.)
Post Reply