Stopping player's movement during conversation in click to move game
-
- Posts: 2
- Joined: Mon Mar 25, 2024 3:00 pm
Stopping player's movement during conversation in click to move game
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!
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
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:
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:
-
- Posts: 2
- Joined: Mon Mar 25, 2024 3:00 pm
Re: Stopping player's movement during conversation in click to move game
That was it, thank you so much for this!
-
- Posts: 28
- Joined: Sun May 28, 2023 8:30 pm
Re: Stopping player's movement during conversation in click to move game
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?
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
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().
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().
-
- Posts: 28
- Joined: Sun May 28, 2023 8:30 pm
Re: Stopping player's movement during conversation in click to move game
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 (303.63 KiB) Viewed 673 times
-
- Posts: 28
- Joined: Sun May 28, 2023 8:30 pm
Re: Stopping player's movement during conversation in click to move game
Apologies for the daft question, I'm new to the processes.
Re: Stopping player's movement during conversation in click to move game
Hi,
I'm not sure what your Player script does, but if it controls player movement then it would probably work to select enabled:
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.)
I'm not sure what your Player script does, but if it controls player movement then it would probably work to select enabled:
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.)