// Use this for initialization void Start() { rb = gameObject.GetComponent <Rigidbody2D>(); levelController = FindObjectOfType <LabBossController>(); if (levelController.isRight) { rSpeed = speed; } else { rSpeed = -speed; } moveDir = new Vector2(rSpeed, 0); rb.velocity = moveDir; }
// Use this for initialization void Start() { levelController = FindObjectOfType <LabBossController>(); }