- Home /
Question by
WanderinOstrich · Dec 04, 2012 at 02:57 AM ·
movementaiwaypoint
Trying to make AI travel (and face) a waypoint
im new to coding and unity, this is for a school assessment here is my present coding, please edit and tell me where i went wrong
var bison: Transform;
var waypoint1: Transform;
private var waypoint: Transform;
function Update(){ if (bison.position.x < waypoint.position.x) bison.position.x += 5; transform.LookAt(waypoint); if (bison.position.z < waypoint.position.z) bison.position.z += 5; if (bison.position.x > waypoint.position.x) bison.position.x += 5; transform.LookAt(waypoint); if (bison.position.z > waypoint.position.z) bison.position.z += 5; }
Comment