make AI follow random waypoints
Hey guys, I have a script that makes my AI characters follow a waypoint system. I’ve also set up a trigger collider so that when they enter it they got to a random waypoint from a set list. The issue is that say there are 20 waypoints total and attached to the trigger is 3 waypoints, no. 1, 5 and 20 then the script randomly selects 5, the second (or first) from the array. Instead of going to point 5 it goes to point 1. I assume this is because the script is talking about ints but I can’t seem to figure it out.
The AI script – http://pastebin.com/aPCsumM7 The waypoint script – http://pastebin.com/9ttTqrh8 The Trigger script – http://pastebin.com/WGtihzwq
Any help is appreciated thanks
Your answer
Follow this Question
Related Questions
Need support on my basic navmesh ai script to follow the player at a certain distance 1 Answer
Editing an AI patrolling script 1 Answer
Enemy AI for Shooting Game 1 Answer
Object to Waypoint script. 1 Answer
AI Waypoint rotate problem 0 Answers