Hi, how can I fix this:
error CS0029: Cannot implicitly convert type UnityEngine.GameObject[]' to
UnityEngine.GameObject
Script:
using UnityEngine;
using System.Collections;
public class EnemyMovement : MonoBehaviour {
public int rotateSpeed = 1;
public int movementSpeed = 1;
private Transform myTransform;
public Transform target;
// Use this for initialization
void Start () {
GameObject go = GameObject.FindGameObjectsWithTag("Player");
target = go.transform;
myTransform = transform;
}
// Update is called once per frame
void Update () {
Rotate();
}
void Rotate () {
Debug.DrawLine (myTransform.position, target.position, Color.red);
}
}