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.

1 Answer

1

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.