I've attempting to make a 2D, top down perspective game. I've been able to set up a player character, animate him, lock the camera, disable gravity, etc. However, I can't seem to wrap my head around a way to create NPCs. I set up my player character's animation controls by gathering input info using GetAxis, and using float values to control a blend tree. However, with NPCs, there is no input value to gather, and thus my animation control script doesn't work, unless I want an NPC that mimics player movement that is. I've been working on this for over a week, and none of the methods I've come up with have worked quite right, and it's frustrating me to the point that I can't think straight anymore.
I am very new to scripting, but are there any simple methods to gather movement data of a non player character? Or, are there some Ork specific methods I can use to animate my NPCs? I'm currently using 4 direction sprites as a test, though I will probably upgrade to 8 direction eventually. I have 4 idle animations, which are actually just still poses, 1 for each direction, and 4 walking animations.
- use the Add Combatant component to add combatants to your NPCs and use Move AIs (e.g. with waypoints)
- use the Event System to move and animate them (e.g. a repeating autostart event)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
For handling the rotation you'll need to write a custom script that stores the rotation (e.g. 1 = up, 2 = down, 3 = right, etc.) and shows the correct sprite and animations ...
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!