When writing C++ code, it's always a good idea to make sure that something exists before using it. In this recipe, we will see how we can check whether a particular object implements a specific UInterface.
Checking if a class implements a UInterface
Getting ready
Follow the first two recipes so that you have a UInterface we can check for, and a class implementing the interface that can be tested against.
How to do it...
- Inside your Game Mode implementation, add the following code to the BeginPlay function:
void AChapter_07GameModeBase::BeginPlay()
{
Super::BeginPlay...