- Home /
Question by
WeirderChimp · Mar 17, 2014 at 06:24 AM ·
errorphotongui-buttonrespawning
GUI.Button Not Working Correctly Strange
hey ive been looking for a while on how to fix this but i cant find it anywhere
void OnGUI ()
{
if (isPlayer && photonView.isMine && !DeadWaitingForRespawn)
GUI.Box (new Rect (Screen.width - 100,Screen.height - 50,100,50), currentHitPoints.ToString());
if (DeadWaitingForRespawn && isPlayer && photonView.isMine)
{
if(GUI.Button (new Rect (Screen.width/2,Screen.height/2,100,50), "Respawn"));
{
//GameObject.Find("_NetworkManager").GetComponent<NetworkManager>().SpawnMyPlayer();
//PhotonNetwork.Destroy(gameObject);
Debug.Log("Respawn");
}
}
}
the problem is that debug.log("respawn"); keeps getting called even when im not pressing the button
Thanks for having a look ~Scott
Comment
Answer by getyour411 · Mar 17, 2014 at 06:24 AM
Try removing the semi-colon from the gui.button line
Ar yes thank you that's what i get for copying and pasteing
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to Fix Compilier Errors? 0 Answers
NullReferenceException: Object reference not set to an instance of an object. 2 Answers
Teleportation Problem 1 Answer
error cs0120 1 Answer