- Home /
how to stop ui button jitter if it has to be called on update
Ok so im making a fps game that is online and im using photonnetwork for it and my question is i have a main menu screen and in the main menu i have ui buttons for singleplayer multiplayer and so on and when i click on multiplayer it switches scenes to multiplayer scene with a team selection made out of ui buttons and i have it so it waits for the photonnetwork in game chat to show up and when it does it also is connected to the server and what happens when it is connected is the ui shows up and when it does it jitters because of it being called on frame by frame to check if Connected == true so yeah i need help please void Update() { if (Connected == true) { Debug.Log("We are now connected"); isShowing = !isShowing; Debug.Log("is showing"); menu.SetActive(isShowing); Debug.Log("set active is working") } if(respawnTimer > 0) { respawnTimer -= Time.deltaTime;
if(respawnTimer <= 0) {
// Time to respawn the player!
SpawnMyPlayer(teamID);
}
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613182719im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Character,Camera,Updates,Frame Rates,Jitter&Stutter, I need some explanations. 0 Answers
How to prevent Unity to execute all the code in the first frame. 1 Answer
Simple rigidbody.AddForce only applying once each time key is pressed 1 Answer
Copy position into var without updating every frame 2 Answers
Force refresh of frame 2 Answers