// Use this for initialization void Start() { isAlive = true; sr = GetComponent <SpriteRenderer>(); sideS = this.transform.parent.GetComponent <EnemiesScript>().sideS; transform.LookAt2D(player.transform, Vector2.up); GetComponent <Rigidbody2D>().velocity = transform.up * speed; }
// Use this for initialization void Start() { sideS = sideGoj.GetComponent <SideScript>(); }