Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Creating an RTS Game in Unity 2023

You're reading from  Creating an RTS Game in Unity 2023

Product type Book
Published in Oct 2023
Publisher Packt
ISBN-13 9781804613245
Pages 548 pages
Edition 1st Edition
Languages
Author (1):
Bruno Cicanci Bruno Cicanci
Profile icon Bruno Cicanci

Table of Contents (23) Chapters

Preface 1. Part 1: Foundations of RTS Games
2. Chapter 1: Introducing Real-Time Strategy Games 3. Chapter 2: Setting Up Unity and the Dragoncraft Project 4. Chapter 3: Getting Started with Our Level Design 5. Chapter 4: Creating the User Interface and HUD 6. Part 2: The Combat Units
7. Chapter 5: Spawning an Army of Units 8. Chapter 6: Commanding an Army of Units 9. Chapter 7: Attacking and Defending Units 10. Chapter 8: Implementing the Pathfinder 11. Part 3: The Battlefield
12. Chapter 9: Adding Enemies 13. Chapter 10: Creating an AI to Attack the Player 14. Chapter 11: Adding Enemies to the Map 15. Part 4: The Gameplay
16. Chapter 12: Balancing the Game’s Difficulty 17. Chapter 13: Producing and Gathering Resources 18. Chapter 14: Crafting Buildings and Defense Towers 19. Chapter 15: Tracking Progression and Objectives 20. Chapter 16: Exporting and Expanding Your Game 21. Index 22. Other Books You May Enjoy

Adding the new Mage unit and ranged attack

It is time to start adding more characters to our RTS game. We already have our Warrior character, and now we are going to use everything we have made so far to add a Mage character. We are going to expand the UnitComponent script to add the ranged attack as well, which will be a fireball cast by the Mage.

Now that we have built many support systems in our RTS game, we can define a clear path to use when we need to include and configure new units in the project. This is what we need to do:

  1. Create a new UnitData Scriptable Object and configure all the base attributes and animation states. We can always use another unit as a reference for the value and tweak it.
  2. Create a new message that will be sent when we need to spawn a unit.
  3. Create a new spawner script and a new object pool, adding the reference to UnitData and the Prefab.

That covers the basics of adding a new unit. However, in the case of the Mage, we are also...

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 $15.99/month. Cancel anytime}