Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x 2D Game Development Blueprints

You're reading from   Unity 5.x 2D Game Development Blueprints Explore the features of Unity 5 for 2D game development by building three amazing game projects

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781784393106
Length 252 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Francesco Sapio Francesco Sapio
Author Profile Icon Francesco Sapio
Francesco Sapio
Abdelrahman Elsayegh Abdelrahman Elsayegh
Author Profile Icon Abdelrahman Elsayegh
Abdelrahman Elsayegh
Arrow right icon
View More author details
Toc

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 the end, the arrow should look like this:

Next, we need to assign a tag to it. Therefore let's click, in the Inspector, on Tag/New Tag. Now the Inspector should display the Tags and Layers menu. Since we are interested in tags, expand the Tags menu...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image