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

Visualizing the Line Trace

When creating new logic that makes use of Line Traces, it is very useful to actually visualize the Line Trace while it’s being executed, which is something that the Line Trace function doesn’t allow you to do. In order to do that, we must use a set of helper debug functions that can draw objects dynamically at runtime, such as lines, cubes, spheres, and so on.

Let’s then add a visualization of our Line Trace. The first thing we must do in order to use the debug functions is to add the following include line of code under our last include line:

#include "DrawDebugHelpers.h"

We will want to call the DrawDebugLine function in order to visualize the Line Trace, which needs the following inputs (that are very similar to the ones received by the Line Trace function):

  • The current World, which we will supply with the GetWorld function
  • The Start and End points of the line, which will be the same as the LineTraceSingleByChannel...
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