- Home /
Artificial intelligence of multiple objects
I need to do something similar to this game:
http://www.youtube.com/watch?v=fmUvR24ajH4&feature=related
Where all objects collisionen each other, with artificial intelligence, the idea is to create a battlefield where I have 6 players, one is controlled by the user, the rest is handled by the cpu, someone can help me with a tutorial or something thank you very much
Comment
Answer by Loius · Jun 29, 2012 at 02:57 PM
class Actor {
function MoveTo() { /* ... */ }
function Attack() {}
}
class AI {
private var actor;
function Start() { actor = GetComponent(Actor); }
function Update() {
/* call MoveTo and Attack as necessary... */
}
}
class Player {
private var actor;
function Start() { actor = GetComponent(Actor); }
function Update() {
/* call MoveTo and Attack as necessary, but use Input. */
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613073453im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Space ship ai 0 Answers
How to make the enemy choose only one cover? 1 Answer
Hi Mlagents not working. 0 Answers
Implementing BUG2 algorithm 0 Answers