How it works...

Inside BeginPlay, we create an empty FTransform object, which has the default value of 0 for all translation and rotation components, so we don't need to explicitly set any of them.

We then use the SpawnActor function from UWorld so that we can create an instance of our SingleActorInterface, storing the pointer to the instance into a temporary variable.

We then use GetClass() on our instance to get a reference to its associated UClass. We need a reference to UClass because that object is the one that holds all of the reflection data for the object.

Reflection data includes the names and types of all UPROPERTY on the object, the inheritance hierarchy for the object, and a list of all the interfaces that it implements.

As a result, we can call ImplementsInterface() on UClass, and it will return true if the object implements the UInterface in question.

If the object implements the interface, and therefore returns true from ImplementsInterface, we then print a message to the screen.