Skip to content
Valentin Plyasinov edited this page Mar 24, 2025 · 20 revisions

Welcome to the Blueprint Component Reference Plugin wiki!

Overview

Blueprint Component Reference provides a universal way of referencing actor components during design time with component picker UI and rich customization.

Installation

There are several ways to install the plugin: from GitHub and from Marketplace (coming soon).

From Github

  1. Download source code archive from main or Releases page
  2. Unpack the contents into "YourProjectFolder/Plugins/BlueprintComponentReferencePlugin" (create if missing)
  3. Activate plugin in editor Plugins menu

From Marketplace (coming soon)

  1. Find plugin in Unreal Engine Marketplace under Code Plugins category: Blueprint Component Reference Plugin
  2. Click on Download, launcher would download it for you to specified engine
  3. Activate plugin in editor Plugins menu

Blueprint Usage Examples

Plugin provides following Blueprint APIs:

  • Component Search is performed with Get Referenced Component, Find Referenced Component, Get Referenced Components nodes.
  • Component Reference state can be checked with Is Valid Component Reference, Is Null Component Reference nodes.
  • Equality and ToString conversion nodes.

Normal Variable:

  • Create new variable of Blueprint Component Reference type in Actor Blueprint
  • In variable properties configure component selection rules and other traits
  • Assign value to variable in details panel
  • Locate referenced component within actor by using Get Referenced Component or Find Referenced Component nodes

Array Variable:

  • Create new array variable of Blueprint Component Reference type in Actor Blueprint
  • In variable properties configure component selection rules and other traits
  • Assign value to variable in details panel
  • Locate referenced components within actor by using Get Referenced Components node

Code Usage Examples

All plugin primary functions located in BlueprintComponentReference module BlueprintComponentReference.h file.

To add plugin features in project following steps are necessary:

  • Enable Blueprint Component Reference Plugin in Plugin Settings
  • Add BlueprintComponentReference module dependency in appropriate Build.cs file
  • Use BlueprintComponentReference.h header file for the FBlueprintComponentReference type

FBlueprintComponentReference type can be used as a single property, array or map value.

Component selection rules and other traits can be specified with metadata specifiers. Latest list of specifiers can be found here

    /* Reference to any actor component */
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    FBlueprintComponentReference SingleComponentReference;
    
    /* Array of references to any native component */
    UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(ShowNative=true, ShowBlueprint=false))
    TArray<FBlueprintComponentReference> TargetComponents;
    
    /* Map that uses reference as value and restricts to SceneComponents only */
    UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(AllowedClasses="/Script/Engine.SceneComponent"))
    TMap<FGameplayTag, FBlueprintComponentReference> SimpleSceneCompReference;

More examples can be found in BlueprintComponentReferenceTests module.

Code Usage Examples (Advanced)

Similar to engine component reference implementation FBlueprintComponentReference does not provide internal cache and each call of GetComponent will do resolve/search.

When repeated component search is an issue there are at least two ways to avoid repeated component search:

  • caching search result separately
  • using TCachedComponentReference helper that wraps FBlueprintComponentReference with a weak object pointer to found component.
Clone this wiki locally