- Home /
Duplicate Question
AI control C#
Hello.
I have this APC with fully working suspension, realistic physics and a turret which shoots.
So How would I get the AI to use this code? Do I have to make whole new code or is there a way to get the player input to be faked? Or is there a way for the AI using another script to override the player input in the APC control script(or a clone of the AI control script)?
Do you understand? I hope I am clear enough. Please help if you can.
Much thanks.
If you want a free script: search and google for 100s of scripts. Even ON THIS SITE you will find a vast number
If you want to purchase an AI script. Open Unity. Using the menu bar (top of your computer -- right near wher the screen ends -- select "Asset Store"
Using PayPal buy a script. $$anonymous$$any are available.
if you want to generally discuss AI, use the forum site (or better, stackoverflow etc)
All of your questions answer "yes". It's completely possible to either (a) change the script or (b) modify the script slightly or (c) have another script change variables in the first script. These are extremely general program$$anonymous$$g questions. All approaches are perfectly valid. It is irrelevant to the issue at hand "how to do car AI"
Answer by Chronos-L · Apr 14, 2013 at 07:42 AM
I would suggest writing another script. To make a AI use a APC is more than just faking player input, you need to teach the AI on decision making (the human player did it in their mind).
So you should write another script that has decision making capability (which path the AI should use, which target to shoot at etc) and the ability to control the APC ( basic acceleration, turning, aiming, you can copy the code from your player-control if possible )
Furthermore, depending on your game design, it is possible that your AI will form a team and make team strategy; or you can design a basic AI to control the APC, but you write another much more complex decision-making AI, it will act as the commander and it will send in command to all the AI in the scene.
This all goes beyond than just faking user input.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How can I more optimize My AI Script 0 Answers
Basic 2d AI follow? 1 Answer
A* pathfinding for 2D top Down 0 Answers