Hey everyone!
I am making a virtual pet game with unity.
And I was wondering if anyone has any advice for how to go about coding simple AI 2D movement.
Right now I have them walking one direction until they see(Raycast) a boundary which makes them go in the other direction.
(Using C# btw)
But essentially I want them to carry out an action, then switch to a another action after that has been completed(And of course switch to actions depending on what the player does as well).
An example:
-Pet walks to the left for a few steps
-Pet sits down
-Pet looks left, then right, then left again
-Pet gets up
-Pet walks to the right
-Player touches pet and it stops and looks towards screen
So would I contain each action in it’s own Method/function?
Then at the end of the Method after the action has been completed(Or changed by the users interaction), select another action by random?(random at this point, but when I get the core functionality working I’ll make this dependent of mood and other things)
I’d appreciate any advice or words of wisdom ^^
Thank you all!