O'Reilly logo

Unity 5.x 2D Game Development Blueprints by Abdelrahman Saher, Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using pathfinding for enemies

Since our scene is AI ready, we can start adding AI characters in order to test what we have done so far.

Shaping our soldier

First, drag the sprite of the enemy character into the scene. For instance, you can use roguelikeChar_transparent 1_21, which resembles a soldier figure and can be found in the RPG Pack/Characters/Spritesheet/roguelikeChar_transparent 1 folder. You can see it in the following image:

Shaping our soldier

This is the sprite that we will use in this chapter. Once we are in the scene, rename the gameObject to Soldier, and set its position to (-0.4,2.25,0) and its scale to (3,3,3).

Then, add a circle collider and a rigid ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required