Quantcast
Viewing all articles
Browse latest Browse all 16

Assets/Scripts/Enemy.cs(61,44): error CS1955: The member `UnityEngine.GameObject.tag' cannot be used as method or delegate

i'm just stuck... here's my code enter code hereusing UnityEngine; using System.Collections; public class Enemy : MonoBehaviour { static bool go_left = false; private int timer = 300; private int rand_num; static int num_chosen; public GameObject Enemy_bullet; public float speed; void Start() { } // Update is called once per frame void Update () { if(go_left) transform.position = transform.position + new Vector3 (-.25f, 0, 0); else transform.position = transform.position + new Vector3 (.25f, 0, 0); timer -=1; if (timer <2) { rand_num = Random.Range(0, 20); num_chosen = rand_num; if (num_chosen == 2) { Instantiate(Enemy_bullet, transform.position, transform.rotation); Vector3 newPosition = transform.position; newPosition.y -= speed * Time.deltaTime; transform.position = newPosition; } timer = 300; } } void OnTriggerEnter(Collider col) { if(col.gameObject.name == "Left_Wall") { go_left = false; MoveDown(); } else if (col.gameObject.name == "Right_Wall") { go_left = true; MoveDown(); } } void MoveDown() { string[] enemies = new string[1] {"aliens"}; string aliens = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var entity in enemies) transform.position = transform.position + new Vector3 (0, -.5f, 0); } }

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>