Fill Inspector Variable via Unity Code

0

I'm trying the following:

When the enemy is instantiated I want it to target my player, all right, but when the enemy comes to the game it does not fill the variable Alvo as I indicated below, in the inspector it gets like (none).

var Alvo  : Transform;

function Update () {
    if (!Alvo)
 {
   Alvo = GameObject.Find("/Tanque").transform;  
 }
    
asked by anonymous 26.02.2016 / 05:17

0 answers