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

Bullets

In this section, we will learn how to create the bullets that our towers will shoot against the enemies.

Creating the bullet prefab

Since these bullets are going to be thrown by the towers, we need to create a prefab that allows us to quickly instantiate one of these. In our game environment, the bullets will be arrows. Feel free to use your own graphics, if you have any.

By right-clicking on the Hierarchy panel, we can select 2D Object/Sprite in order to create a new Sprite. Of course, we need to assign the graphic of the arrow, which can be found in the graphic package, and adjust its scale to fit our game environment. In this case, we can set 1.5 to the whole scale vector. Furthermore, we need to set the Z-axis of the position to -2. In ...

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