Page 1 of 1

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

Posted: Mon Mar 25, 2024 3:18 pm
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!

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

Posted: Mon Mar 25, 2024 4:02 pm
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:

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

Posted: Mon Mar 25, 2024 8:05 pm
by utopologist
That was it, thank you so much for this!

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

Posted: Mon Mar 25, 2024 8:54 pm
by Tony Li
Happy to help!

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

Posted: Sat Apr 20, 2024 4:44 pm
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?

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

Posted: Sat Apr 20, 2024 4:48 pm
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().

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

Posted: Sat Apr 20, 2024 4:59 pm
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.

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

Posted: Sat Apr 20, 2024 5:02 pm
by Eldritch_Horror
Apologies for the daft question, I'm new to the processes.

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

Posted: Sun Apr 21, 2024 12:36 am
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 46 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.)