- Home /
Button stuck on pressed
Hello, i'm working on the gui of a game with a friend, but our "settings" button gets stuck in pressed state :
When we click the button, every Panel of our canvas is desactivated ( SetActive(false); ) and then, the required Panel is enabled.
On the settings Panel, there is a button to go back to the MainPanel, it does the same thing (deactivates everything then acitvates the right one).
When i go back to the first Panel, the settings button is stuck in th middle of the Pressed Animation
Here is the panel switching script :
using UnityEngine;
public class SettingsMenu : MonoBehaviour
{
public GameObject mainMenu;
private void Start()
{
DesactMenus();
mainMenu.SetActive(true);
}
public void ActPanel(GameObject panel)
{
DesactMenus();
panel.SetActive(true);
}
public void DesactMenus()
{
foreach(Transform child in transform)
{
child.gameObject.SetActive(false);
}
}
}
And here is the button settings :
Answer by Mouton_redstone · Mar 27 at 09:29 AM
EDIT : I didn't set the "Normal" animation, now it works perfectly
Answer by PiterQ70 · Mar 26 at 06:50 PM
@Mouton_redstone I'm pretty sure it stuck on Selected add transtion to Exit,I'm pretty sure it stuck on Selected add transtion to Exit
Your answer
Follow this Question
Related Questions
Play an animation when UI button is pressed 0 Answers
How to disable button animation fade? 1 Answer
Material Design Menu 1 Answer
Unity 4.6 UI Button Click Animation? 4 Answers