How to assign USceneComponent UPROPERTY through details panel?

I have an object in the scene as such:

  • Door (custom AActor)
    • Lock (custom USceneComponent or UActorComponent)

Then I have another object in the scene as such

  • Pressure plate (custom AActor)
    • Lock (UPROPERTY of the Doors Lock)

I am unable to set the Lock UPROPERTY on the Pressure plate actor because it seems to accept only Assets. What I want to do is to link the Lock UPROPERTY to the Lock Component on the door, so I can unlock it. Is there any way to make child components referable through UPROPERTYs on different objects in the level?

Depending on the class name of the component it will look something like this:

Inside the door

UPROPERTY(editAnywhere, BlueprintReadWrite)
ULockComponent * lock;

The you can set it in editor

You have to make sure the uproperty is accessible

So either under:
Public:
Or
Protected:

If it is under
Private:
You need a setter and a getter to access it.

Greetings @SauceChord !

Just so you’re aware, this topic has been moved from the International forum category to the Development - Programming & Scripting - Blueprint forum category.

Just remember, when posting, please review the categories to ensure your topic is posted in the most relevant space.

Happy Developing!

'- Your Friendly Neighborhood Moderator :smiley:

1 Like