#popup window closing
1 messages · Page 1 of 1 (latest)
oh ok ty
//public class Exclaim : MonoBehaviour
{
public Animator animator;
public string text;
public string txt;
// Start is called before the first frame update
void Start()
{
animator = GetComponent<Animator>();
}
public void isExclaim()
{
animator.SetBool("Exclaim", true);
}
public void isClosed()
{
animator.SetBool("Exclaim", false);
}
public void whiteBoard()
{
PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent<PopUpSystem>();
pop.PopUp(text, txt);
}
}```
https://paste.ofcode.org/BaKJrpuZTTsbjijdxyfjyY
ok thats everything here
So i assume whats happening is when you close it, the animator variable gets set to close and never gets set back to its original value
oh
you would set it back when you open the menu
yea i saw, do u know how to set that trigger back?
you would have to do it when u open the menu
no, the issue is that "close" was set to trigger, and never set to stop
https://docs.unity3d.com/ScriptReference/Animator.SetTrigger.html
try using this example, it has a function in it, ResetTrigger
do u have a button similar to this image here, because this has the On Click method which sets the trigger for close. You can likely add another for a reset trigger
but itd be for the button that opens the menu
no i have no button for the pop up
the isClosed in that is also for another animation
the popup is the whiteborad funciton
OMG
IT OWRKS NOW
TYSM
im not entirely familiar with this code style honestly but glad it works
np
typically u can google the function u are using, and the unity docs will have examples of how to use it
i cant express all my gratitude
in that example i just saw ResetTrigger