So, I'm trying to figure out the best way to move and control an enemy in a 2d, top down, action rpg. I'd prefer to use Rigidbody2d/velocity so I can control the character's orientation with mecanim while having true collision, but ork doesn't seem to have a lot of options dealing with 2d velocity. I know Makinom handles 2d movement pretty well but that leaves the problem of dealing with ork's battle AI.
How can I manage the battle actions of an enemy while moving him around with Makinom/Rigidbody2d? Is it possible? If not, is there a work around so I can continue to take advantage of ork's many great features?
The move AI only uses a simple (character controller) default movement script - but you can also use NavMesh and custom scripts. If you want to use rigidbody 2D for movement, you'd need to write your own script for a that. Or just use character controllers or NavMesh :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Edit: Okay, so the move AI sets the position the combatant is moving to with the use of the character controller while the simple move rotates the character in that direction with transform.LookAt also while controlling the speed it moves at. Unfortunately, I'm even more lost at how to replace this with ridgidbody 2D. There will be no rotation, only the change in X and Y velocity.
The direction can be calculated by subtracting the current position from the target position, e.g.:
rigidbody2D.velocity = (targetPositon - transform.position) * speed * Time.deltaTime;
speed is a float, targetPosition the Vector3 position you want to move to.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!