Class Creation Basics

Examples showing how to create classes with Blueprints alone, C++ alone, and a combination of C++ and Blueprints.

On this page


These examples show how to create a new class using Blueprints only, C++ code only, and a combination of C++ code and Blueprints. The goal is to create new LightSwitch classes with the same properties and behavior using all three workflows, and then add an instance of each new class to the level, so there are three new LightSwitch Actors.

LightSwitch classes are based directly on the Actor class, since their primary requirement is that they can be placed within the level. They contain a PointLightComponent as the root component, and a SphereComponent that is a child of the PointLightComponent. Each LightSwitch class also has a variable called DesiredIntensity, which is used to set the intensity of the PointLightComponent. Finally, the default behavior of the classes is that when the player enters or leaves the SphereComponent, the PointLightComponent's visibility will be toggled.


Select Skin
Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback