I have already referred the animator by using the statement,
Animator anim;
But,What is the use of getcomponent in awake() function.What happens without it.
I have already referred the animator by using the statement,
But,What is the use of getcomponent in awake() function.What happens without it. |
|||
|
Your first sentence is incorrect |
|||
|
if you make a public variable like
in a monobehavior script, outside any method, you can drag and drop a gameobject with animator component in inspector when you add this script to a gameobject. it will automatically get the Animator component from the dropped gameobject. But if you already have a reference to the desired gameobject(g) with a Animator component, you can get a reference to it by
|
|||
|