I’m writing a custom override region for our game that allows me to override various params on different actors/components when the player enters the region.
For example, lerping between different fog density values in different parts of the level (there’s many settings I’d like to control on a region by region basis).
The override region actor contains references to the components it’s overriding.
The problem is I can’t for the life of me figure out how to assign other actors’ components to this param in the detail panel, or if that’s even possible?
EDIT: I found the ‘AllowAnyActor’ specifier but it doesn’t seem to make any difference.
I don’t know if that’s possible but what you can do instead: change it to actor ref instead of component and then in your code do GetComponentByClass on that actor
Unfortunately this won’t work in my case because the actors in question have multiple of the same component. I’m trying to avoid using a get-by-name approach but that might be the best option.
The built-in solution to your problem is to use FComponentReference or FSoftComponentReference instead of a direct reference to the component. Properties of these types will allow you to select existing components from actors in the details panel. In the past I experienced some bugs with these, and they require casting the selected component since they store a generic UActorComponent, so I implemented my own solution based on them, but they may work well enough for you now. At the very least it is a starting point for you to figure out your own solution to the problem.
They have meta options that you will want to set, like AllowAnyActor, UseComponentPicker, and AllowedClasses; you can see how these work by searching looking at where these types have been used in Unreal Engine’s source code, or look directly at their details panel customization code (FComponentReferenceCustomization).