- Home /
AI Movement (Jets, Spacecraft), Animation and Mecanim
Hi there,
I'm working on a Star Fox-like project in Unity Free, have started the AI system, and am having some difficulties figuring out where to start when it comes to animation.
I have all of my player movements handled programmatically currently, and it works great -- though I'm not sure the utility of Mecanim in this case, if I ought to be using it I would adapt.
Currently, I am using the following FSM to handle the AI state and decision-making behavior:
http://wiki.unity3d.com/index.php?title=Finite_State_Machine
I have also made an AnimationController in Mecanim that more-or-less follows the same structure as my FSM to handle the actual movement.
My question is in regards to implementing movement. I have checked out a few different methods to handle movement such as Splines, Movement Curves, and programmatic implementations.
My goal is to create a rather simple movement system at first, for now making the state change based on time (or distance from player):
Enter the map by flying in (Pre-made Spline? Movement Curve? Pure programming?)
Hover about and fire some shots (Likely handled by programming?)
Leave the map by flying out (Same as 1)
So, my question is... Many-fold:
For Star Fox-like enemy movements (basically what I've described), what would the best method be for handling the flying in, and out, and hovering (bobing up/down, side-to-side)? I can see the benefits of using Splines to really customize the movement paths, and can also appreciate the flexibility that doing this by code provides, and perhaps using Animation Curves as well.
Would any of these types of movements appropriately be handled by Mecanim at all? As far as I can tell from playing around and reading the manual, Mecanim is not used for programmatic movement, I'm using the free version so cannot use the Animation Curves inside of Mecanim, and I'm not sure if Spline-based movement would be handled either. From what I understand, Mecanim is pretty much for .anim files, as in, made by an artist/3D designer.
Should I even be using Mecanim in this case? If I do end up going for... Well, ANY of the implementations I know of, it looks as if I could handle this right inside the AI script itself, which leaves me questioning why I have a Mecanim AnimationController at all...
Any advice, resource links, etc. that may help my understand of these subjects would certainly be appreciated. Maybe I've failed at conceptualizing the problem, or understanding the uses of Mecanim or other components? Or perhaps it's a matter of not seeing the forest through the trees. In any case, thank you for any and all help!
Your answer
Follow this Question
Related Questions
How do I use Mecanim on an NPC? 2 Answers
how to set mecanim parameters for an ai? 0 Answers
More realistically interaction with soccer ball 0 Answers
AI shooting me and mecanim 1 Answer