Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity awake

Use Awake to initialize variables or states before the application starts. 
  Unity calls Awake only once during the lifetime of the script instance.
  
It's useful to do things like this:
public class ExampleClass : MonoBehaviour{
    private GameObject target;

    void Awake(){
        target = GameObject.FindWithTag("Player");
    }
}
 
PREVIOUS NEXT
Tagged: #unity #awake
ADD COMMENT
Topic
Name
2+1 =