Quantcast
Viewing latest article 7
Browse Latest Browse All 86

Answer by Vandarthul

private var stopWaypointLoop: boolean; function Start () { functionState = 0; stopWaypointLoo = false; } function Update () { if(stopWaypointLoop == false) { if (functionState == 0) { Accell (); } if (functionState == 1) { Slow (); } waypoint = waypoints[WPindexPointer]; } } function OnTriggerEnter () { functionState = 1; WPindexPointer++; if (WPindexPointer >= waypoints.Length) { stopWaypointLoop = true; // when the NPC reaches last waypoint, with this code we stop it from doing that. WPindexPointer = 0; // NPC keeps going on waypoints. } }

Viewing latest article 7
Browse Latest Browse All 86

Trending Articles



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