// Use this for initialization void Start() { aiControl = new CivilianAIEntity(new Vector(100,100)); //This position won't really work, and it will need to convert easily to / from Vector3 aiControl.setDestinationWaypoint(new Vector(0,0)); Debug.Log ("lol"); Debug.Log("npc class " + EntityManager.globalInstance().numberOfEntities()); }
public void Start() { if (Network.isServer) { aiControl = new CivilianAIEntity(new Vector(100,100)); //This position won't really work, and it will need to convert easily to / from Vector3 Vector destination = new Vector(UnityEngine.Random.Range(-200,200),UnityEngine.Random.Range(-200,200)); while (queryPoint.isWalkable(destination) == false){ destination = new Vector(UnityEngine.Random.Range(-200,200),UnityEngine.Random.Range(-200,200)); } aiControl.setDestinationWaypoint(destination); seeker = GetComponent<Seeker>(); controller = GetComponent<CharacterController>(); //Start a new path to the targetPosition, return the result to the OnPathComplete function //seeker.StartPath (transform.position,targetPosition, OnPathComplete); newPath(); } else { enabled = false; } }