Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Delayed respawn timer

public class DemoBehaviour : MonoBehaviour {
    public GameObject otherGameObject;
 
    public void Foo() {
        StartCoroutine(TemporarilyDeactivate(20));
    }
 
    private IEnumerator TemporarilyDeactivate(float duration) {
        otherGameObject.SetActive(false);
        yield return new WaitForSeconds(duration);
        otherGameObject.SetActive(true);
    }
}
Source by forum.unity.com #
 
PREVIOUS NEXT
Tagged: #Delayed #respawn #timer
ADD COMMENT
Topic
Name
2+6 =