edited March 2014 in ORK Support
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.
  • There are two possible ways to do this out of the box:
    - 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)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for the response! I haven't tried move AIs yet. I'll see about using the Even System. I've been able to use it to make NPCs move and interact, but I haven't had much luck getting them to animate properly, though I can dig deeper if I know it's possible. I've been trying to write a control script to attach to NPCs to animate them when they move automatically, or when a specific function is called. Do you know of a good method to use to get an object's movement, specifically which direction it's moving? My game objects themselves aren't rotating, and I'm trying to find ways to get movement info to feed to my animation controller so it can display the proper sprites. If nothing else, it would good to know which direction characters are "looking" so I can make them interact properly, since I can't use Ork's Turn Towards Player/Event settings without rotation.
  • edited March 2014
    To animate them when using the event system, you either have to simply play the animation in the event, or also add a combatant to the NPC which handles the animations.

    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 ...
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.