Components

A Component is a piece of functionality that can be added to an Actor. Components cannot exist by themselves, however when added to an Actor, the Actor will have access to and can use functionality provided by the Component.

For example, a Spot Light Component will allow your Actor to emit light like a spot light, a Rotating Movement Component will make your Actor spin around, or an Audio Component will make your Actor able to play sounds.

When adding Components to an Actor, you are putting together the bits and pieces that will make up that Actor as a whole who will be placed in your level(s). For example, the wheels on a car, the steering wheel, the body of the car, the lights etc. would all be considered as Components while the car itself is the Actor.

Once you have added the Components that define your Actor, it is important to note that you can place the Actor in your level even without providing any Blueprint script (or C++ Code) as to how the car should function (as in the real world, a car can exist as an object without a driver providing the instructions to tell the car what to do). Since the "gas pedal" would be a Component, through script or code you would indicate that the gas pedal has been pressed and in turn provide the logic for the car to speed up. Each Component could then be accessed in this manner (turning on the lights, honking the horn, turning up the radio, steering, etc.)

Component Instancing

Contrary to the default behavior of sub-objects in general, Components created as sub-objects within an Actor are instanced, meaning each Actor instance of a particular class gets its own unique instances of the Components. A simple way to visualize this is to imagine the vehicle described above. A Car class might use Components to represent the wheels of the car. Four Wheel Components would be created as sub-objects in the default properties of the class and assigned to a "Wheels" array. When a new Car instance is created, new instances of the Wheel Components are created specifically for that particular Car. If this were not the case, when one Car in the world moved, the wheels of all Cars would turn; which is clearly not the desired behavior. Instancing of Components by default simplifies the process of quickly adding unique sub-objects to Actors.

Without Component instancing, all Component variables would need to be declared using the Instanced property specifier.

Component Types

There are several different types of Components that can be added to an Actor, refer to the links below for more information:

You can also refer to the Components section of the Unreal Engine API Reference for additional Components.