Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Elevating Game Experiences with Unreal Engine 5

You're reading from   Elevating Game Experiences with Unreal Engine 5 Bring your game ideas to life using the new Unreal Engine 5 and C++

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781803239866
Length 760 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Authors (4):
Arrow left icon
Gonçalo Marques Gonçalo Marques
Author Profile Icon Gonçalo Marques
Gonçalo Marques
Devin Sherry Devin Sherry
Author Profile Icon Devin Sherry
Devin Sherry
David Pereira David Pereira
Author Profile Icon David Pereira
David Pereira
Hammad Fozi Hammad Fozi
Author Profile Icon Hammad Fozi
Hammad Fozi
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Chapter 1: Introduction to Unreal Engine 2. Chapter 2: Working with Unreal Engine FREE CHAPTER 3. Chapter 3: Character Class Components and Blueprint Setup 4. Chapter 4: Getting Started with Player Input 5. Chapter 5: Query with Line Traces 6. Chapter 6: Setting Up Collision Objects 7. Chapter 7: Working with UE5 Utilities 8. Chapter 8: Creating User Interfaces with UMG 9. Chapter 9: Adding Audio-Visual Elements 10. Chapter 10: Creating the SuperSideScroller Game 11. Chapter 11: Working with Blend Space 1D, Key Bindings, and State Machines 12. Chapter 12: Animation Blending and Montages 13. Chapter 13: Creating and Adding the Enemy Artificial Intelligence 14. Chapter 14: Spawning the Player Projectile 15. Chapter 15: Exploring Collectibles, Power-Ups, and Pickups 16. Chapter 16: Getting Started with Multiplayer Basics 17. Chapter 17: Using Remote Procedure Calls 18. Chapter 18: Using Gameplay Framework Classes in Multiplayer 19. Index 20. Other Books You May Enjoy

Understanding how to spawn actors

In Chapter 1, Introduction to Unreal Engine, you learned how to place an actor that you created in the level through the editor, but what if you wanted to place that actor in the level as the game is being played? That’s what we’re going to be taking a look at now.

UE5, much like most other game development tools, allows you to place an actor in the game while the game itself is running. This process is called spawning. To spawn an actor in UE5, we need to call the SpawnActor function, available from the World object (which we can access using the GetWorld function, as mentioned previously). However, the SpawnActor function has a few parameters that need to be passed, as follows:

  • A UClass* property, which lets the function know the class of the object that will be spawned. This property can be a C++ class, available through the NameOfC++Class::StaticClass() function, or a Blueprint class, available through the TSubclassOf property...
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 £16.99/month. Cancel anytime