Game Over panel do not setactive true when collide with enemy, Why ? Please help!
I made a game , everything is fine and working in editor, i also test by connecting unity remote5, But when i generate apk and install on mobile devices, Game over panel is not set active true, gameover sound play, player dead animation is working but panel is not showing.... i tried on every version of Android...I am using unity 2020.2.7 and updated sdk, ndk, jdk versions.
does anybody know the solution please help!... Simple Code is here. I don;t know what is happening. This code is working on editor , but not working on mobile devices. How is it possible.
void Update() {
if (GO_Test == true)
{
if (timeRemaining > 0)
{
Debug.Log(timeRemaining);
timeRemaining -= Time.deltaTime;
}
else if (timeRemaining <= 0)
{
GameoverPanel.SetActive(true);
test = false;
}
}
}
public void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.tag == "Ground")
{
pointmanager.pointget = false;
test = true;
rb2D.AddForce(Vector2.right * 1000, ForceMode2D.Impulse);
WaitforEnd();
}
if (collision.transform.tag == "Water")
{
pointmanager.pointget = false;
test = true;
rb2D.AddForce(Vector2.right * 1000, ForceMode2D.Impulse);
WaitforEnd();
}
if (collision.gameObject.tag == "Stone")
{
pointmanager.pointget = false;
test = true;
rb2D.AddForce(Vector2.right * 1000, ForceMode2D.Impulse);
WaitforEnd();
}
}
public void WaitforEnd()
{
Deadfx.Play();
pointmanager.pointget = false;
MoveLeft.speed = 0;
MoveLeft1.speed = 0;
MoveLeft2.speed = 0;
new_drop.enabled = false;
GO_Test = true;
test = true;
}
Your answer
Follow this Question
Related Questions
SetActive is just working if i press twice in the first time 2 Answers
Reference a script on a gameobject that is disabled in scene 0 Answers
Grappling gun line still has line when inactive 0 Answers
Instantiate() and Destroy() vs setActive() 1 Answer
How to keep bool true even when other method try to set it off 0 Answers