I’m planning to make AI that can basically do anything the player can do the only obvious difference is it’s not controlled by a player instead I’m going to use a behavior tree and I wanna use composition to do this neatly.
My current plan is going to be to make 3 classes (module scripts) a character class that will set up everything they have in common methods, states, health, walk speed, etc. Then a player class will probably just handle input, and then the AI class which will control the behavior tree.
The issue though is I don’t think this is how composition works so what would be the proper way to go about doing this?
Edit: if I’m understanding this correctly essentially what I need to do is isolate the needed behavior into its own class and then add then I can just add that behavior to any class that needs it?