Components Window

Choose your OS:

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.

For more information on Components, please see the Components Overview documentation.

Components Window

With an understanding of Components, the Components window inside the Blueprint Editor allows you to add Components to your Blueprint. This provides a means of adding collision geometry via CapsuleComponents, BoxComponents, or SphereComponents, adding rendered geometry in the form of StaticMeshComponents or SkeletalMeshComponents, controlling movement using MovementComponents, etc. The Components added in the Components list can also be assigned to instance variables providing access to them in the graphs of this or other Blueprints.

components_pane.png

Adding Components

To add a Component to a Blueprint from the Components window:

  1. Select the type of Component you want to add from the dropdown list, i.e. a CameraComponent.

    add_new_component_list.png

  2. After selecting a Component from the list, you will be prompted to enter a name for your Component.

    nameComponent.png

Components can also be added by dragging-and-dropping assets from the Content Browser into the Components window.

drag_asset_components_list.png

Assets this method applies to include: StaticMeshes, SoundCues, SkeletalMeshes, and ParticleSystems.

Removing Components

To remove a Component from the Components window, Right-click on the Component's name and select Delete.

delete_component.png

You can also select the Component in the window and press the Delete key to remove it as well.

Transforming Components

Components, when added to an instance in your level, are placed by default at the location of that instance. However, they can be Transformed, Rotated, and Scaled as necessary in either the Details panel or the Viewport similar to the method in which you can Transform Actors .

You can select Components for transformation either by clicking on their name in the Components window or by clicking directly on the Component in the Viewport. When Transforming, Rotating, and Scaling your Components in the Viewport, hold Shift to enable snapping. This snapping requires that snapping be enabled in the Level Editor and uses the Snap Grid settings from the Level Editor (see Viewport Toolbar for more information on Grid Snapping).

Exact values can also be entered for Location, Rotation, and Scale in the Details panel for your selected component.

transform_details.png

Transforming, Rotating, or Scaling a parent component will propagate the transformation down to all child components as well.

Component Assets

Once you have added a Component, you may need to specify the asset to occupy the Component (such as assigning a Static Mesh to use for a StaticMeshComponent). There are a couple of different ways you can assign an asset to use for a Component type as described below.

Assigning Component Assets

To assign an asset to a Component in the Components window:

  1. With the Component selected, in the Details panel find the section that corresponds to your Component type.

    emptyComponent.png

    Above we have added a StaticMeshComponent and under StaticMesh is where we would assign the asset to use.

  2. Click the Static Mesh drop-down box, then select the asset to use from the context menu.

    selectComponentList.png

Another method of assigning an asset can be done using the Content Browser:

  1. Select the asset you would like to assign as the asset to use with your Component in the Content Browser.

    selected_asset.png

  2. With the Component selected, in the Details panel find the section that corresponds to your Component type.

    emptyComponent.png

    Above we have added a StaticMeshComponent and under StaticMesh is where we would assign the asset to use.

  3. Instead of clicking the Static Mesh box, since an asset is selected in the Content Browser, click the k2_button_use_scs.png button.

    copy_asset.png

    This will assign the asset selected in the Content Browser as the asset to use in the Component.

Removing Component Assets

To clear an assigned asset from a Component:

  1. In the Details panel for the Component, click the resetButtonIcon.png button next to the currently assigned asset.

    resetAssetButton.png

  2. Or, click the Current Asset box for your asset, then select the Clear from the context menu.

    Clear

    In either method, the asset will be removed as being assigned to the Component.

Browsing to Component Assets

You can also browse to a currently assigned asset of a Component, jumping to and locating in the Content Browser:

  1. In the Details panel for the Component, press the Blueprint - Browse Asset Button button next to the currently assigned asset.

    lookup_asset.png

  2. The Content Browser opens showing the assigned asset selected.

    selected_asset.png

Renaming Component Instance Variables

Components created in the Components window will have an automatically generated instance variable name based on their type.

To change the name of these variables:

  1. Select the component in the Components window and its details will appear in the Details panel.

    new_component_details.png

  2. Enter a new name for the component in the Variable Name field in the Details panel and confirm by pressing Enter.

    You can quickly rename a Component by selecting it in the Components window then pressing F2.

Component Events and Functions

You can quickly add events and/or functions based a Component to the Event Graph of the Blueprint through different methods. Any events or functions created in this manner are specific to that particular function and do not have to be tested to verify which Component is involved.

  1. Add a Component for which events can be created, such as a BoxComponent.

    AddBoxComponent.png

  2. Provide a name for your Component, here we called it Trigger.

    NamedBoxComponent.png

  3. In the Details panel, click the Add Event button and select your desired event type.

    AddEventButton.png

    You can also Right-click on the Component in the Components window and select your event from the Add Event context menu.

    RightClickAddEvent.png

  4. In either manner, a new event node (based on the type you selected) will be added to the Event Graph which will automatically open.

    EventAdded.png

Events and Functions can also be added for a Component from the Event Graph through the My Blueprint window:

  1. In the My Blueprint window, under Components, select your Component.

  2. Right-click in the graph to bring up the context menu.

    EventsAndFunctionsArea.png

    If the component has any associated events or functions, they will be listed at the top.

    Not all Components have associated events. For instance, a PointLightComponent only has functions.

    You can also Right-click on the Component in the My Blueprint window to access the Add Event context menu.

    RightClickMyBlueprint.png