Interfacing communication across classes in UE5
Interfaces are a class that facilitates communication between different classes, without either class being aware of the other’s type. An interface class holds a set of common functions that can be implemented on any class through polymorphism.
To abstract this, let’s think about a ridiculous situation where you have a stack of pages, and you are asked to verify that it is indeed a copy of War and Peace that is just missing the cover. The only way to be truly sure is to compare each word on every page with a verified copy. This is time-consuming and along the lines of what Unreal Engine does when casting a class to another type.
Important note
This isn’t exactly what the engine does. There are efficiencies built in that speed this process up, ensuring that it is not the entire class that is checked, but the point still remains that casting can be needless.
If we dig deeper into this hypothetical, knowing...