There is a node named Cast To that tries to convert reference variable types to new specified types. To understand casting, it is necessary to remember the concept of inheritance between classes, as we covered in Chapter 3, Actors and the Gameplay Framework.
The following diagram represents a Blueprint called BP_GameModeWithScore. Game Mode Base is the parent class of this Blueprint. Based on the inheritance concept, we can use a variable of the Game Mode Base object reference type to reference an instance of BP_GameModeWithScore. However, this variable is unable to access the variables and Functions that were defined in the BP_GameModeWithScore Blueprint:
Therefore, if we have a Game Mode Base object reference, we can try to cast this reference using the Function Cast To BP_GameModeWithScore. If the instance is of the BP_GameModeWithScore type, then Cast...