I’m trying to make an AI type thing for a game, based on random points, and this is the code:
using UnityEngine;
using System.Collections;
public class peopleAI : MonoBehaviour {
public Vector3[] randomGotoPoints;
public Transform gotoLocation;
private Vector3 gotoLocationPlace;
private int place;
// Use this for initialization
void Start () {
}
// Update is called once per frame
IEnumerator Person () {
place = Random.Range (0, randomGotoPoints.Length);
gotoLocationPlace = randomGotoPoints.GetValue (place);
gotoLocation.Translate (gotoLocationPlace);
yield return null;
}
}
It says I can’t convert an object to UnityEngine.Vector3. I don’t see how that there is an object.
I want it to choose a random value from the array, then have an object go to that place.