Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity set active for seconds

public class ActivatorObject : MonoBehaviour
 {
     public GameObject objectToActivate;
 
     private void Start()
     {
         StartCoroutine(ActivationRoutine());
     }
 
     private IEnumerator ActivationRoutine()
     {        
         //Wait for 14 secs.
         yield return new WaitForSeconds(14);
 
         //Turn My game object that is set to false(off) to True(on).
         objectToActivate.SetActive(true);
 
         //Turn the Game Oject back off after 1 sec.
         yield return new WaitForSeconds(1);
 
         //Game object will turn off
         objectToActivate.SetActive(false);
     }
 }
Comment

PREVIOUS NEXT
Code Example
Csharp :: fair division 
Csharp :: canty obituary schenectady ny 
Csharp :: SIMPLE HTTP REQUEST C# 
Csharp :: unity get selected gameobject 
Csharp :: unity c# check if multiple keys are pressed 
Csharp :: .net core authorizationhandlercontext 
Csharp :: unity unparent 
Csharp :: how is c# pronounced 
Csharp :: unity move object to mouse position 
Csharp :: convert dto to dictionary c# 
Csharp :: message uwp c# 
Csharp :: c# read char 
Csharp :: c# create instance from type 
Csharp :: unity keycode 
Csharp :: how to make an object jump in unity 
Csharp :: set object to random color unity 
Csharp :: c# convert object to string 
Csharp :: c# linq to dictionary 
Csharp :: how to add a list to observablecollection in c# 
Csharp :: c# func with no return 
Csharp :: c# convert string to int 
Csharp :: c# update value in a json file 
Csharp :: get query string parameter from string value c# 
Csharp :: round float c# 
Csharp :: unity hide mesh 
Csharp :: get 2d rotation from 2 position math 
Csharp :: triangle minimum path sum c# 
Csharp :: c# foreach dictionary 
Csharp :: c# declare an int list 
Csharp :: polybius square 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =