IEnumerator KillZombie() {
yield return new WaitForSeconds(zombieDeathDelay); // waits for zombie corpse removal delay
PhotonNetwork.Destroy(gameObject);
Debug.Log(“Zombie Died”);
nm.zombieDied();
}
i am using this code, but i really cant figureout why its not working. plz give me any suggestion or help that what should i do?
or give me any other script!
thanks
After looking at your script it seems perfect to me. check your logs and and show us some more detail. Also try to do reimport all and refresh in your assets folder this can update the changes you made if you import any plugin.
for your help try this unity guide and video on unity
http://docs.unity3d.com/Manual/Coroutines.html
http://unity3d.com/learn/tutorials/modules/intermediate/scripting/coroutines
unity timer c# script
Hope you will find this helpfull.
What exactly is not working? Are you seeing your debug message?
I commented out the PhotonNetwork lines as I’m not using Photon and your code worked fine.
Just call it with
StartCoroutine(KillZombie());
and it should work. Unfortunately I can’t help if its Photon related issue
