Im making a racing game for android, and im trying to add more cars that will be your opponents. If anyone could give me the script for it, or explain to me how it is done, I would be willing to pay a $40 reward, if i can get it to work.
asked Mar 30 '11 at 03:03 PM
Lol, money might make some people post =P.
Have nodes on the map... These nodes are just path ways. And each set have their own tag... so like, set 1 set 2, 3, 4, etc...
So, you have the racer start at 0, (Start...), then you have a script....
If the time is 0 (Go time... going to assume it'll be like, 3-2-1 GO), if time is 0, find new target, each racer finds next tag... so the tag would be followed as... "i", so, you i++, get the next tag, it adds all those tags (Use a for:each), so, it adds those in to the array (You can use a List), so now, it random number's, and grabs that number of the array/List, and it goes to that one... And so on until it's done... And when target is reached, it goes for the next one... if that makes sense...
=) Hope this sparks an idea in the least... And don't worry about the money... Go and buy your girlfriend/wife dinner and tip the waiter/waitress the rest for me =).
answered Mar 30 '11 at 03:16 PM
I'd suggest taking a look at this tutorial
Paying special attention to Step 5 where AI is explained. Although for your benefit I'd suggest doing the tutorial from scratch.
Within the downloadable project is the complete AI script which uses waypoints to make the AI cars go around the tracks.
With regard to offering money for work/solutions, the correct place to post that is in the Unity Forums under the Commerce section.
answered Mar 30 '11 at 03:13 PM