Inheritance
In OOP, classes can inherit variables and Functions from other classes. When we are creating a Blueprint, the first thing we have to do is choose the parent class of this Blueprint. A Blueprint class can only have one parent class, but can have several child classes. The parent class is also known as the superclass, while the child class is known as the subclass.
As an example of using inheritance, imagine that we are creating several Blueprints that represent different types of weapons in a game. We can create a base Blueprint class called Weapon with everything that is common to all weapons in the game. Then, we can create the Blueprints that represent each of the weapons using the Weapon class as the parent class. The following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access