- Home /
The question is answered, right answer was accepted
I need help with a Button Bug
Guys i'm making a "visualnovel/rpg" and i've created a buttonmanager and a chatboxmanager but when i activate the chatbox to show the dialog and the player was walking to the right or left using the buttons in the interface the player keeps walking forever to the right or left (depending on the button that was being pressed) because i disabled in the moment it was being pressed how do i solve it because the chatbox needs to appear and the "walk buttons" need to appear when the chatbox go away?
Player Was Walking --> buttons get hided --> ChatBox Appears --> Chatbox Close --> player walks forever to the right or left(whatever was being pressed)
Supposing you are using a similar script as this one, simply add
public void Sleep()
{
SetVelocityZero();
rb.Sleep();
}
public void WakeUp()
{
rb.WakeUp();
}
And call the appropriate function when enabling / disabling your buttons.
Answer by leedyl2003 · Jul 19, 2019 at 05:15 AM
You aren't very clear in your description, but I'm going to try and offer some advice.
Add a mechanism so that when the walk buttons disappear, the player stops walking.
When the chatbox appears, make the player stop walking
Disable "buttonmanager" when the chatbox appears
I don't know what else to say. You are extremely unclear in your description because of your poor punctuation, capitalization, and sentence structure.
i know, sorry my english is not that good... but i solved the problem thank you for helping me friend ;)
Follow this Question
Related Questions
My dialogue system has a strange bug 0 Answers
Strange GUITexture Bug?? 0 Answers
Question about raycasting and UI button 0 Answers
Problem with my button 2 Answers
A button inside of a button is highlighting parent button 1 Answer