Building a UActorActionUtility from C++

Hey UDN,

I was hoping to implement an UActorActionUtility inherited object to allow users to change actors of a certain class into multiple others depending on some internal logic about its properties. This is in UE 5.4.

There are a few ways to do this and due to time constraints will implement them in another way for now, but I wanted to know if this was possible.

I got stuck attmpting to add to the “SupportedClasses” array from code. The property is private in the parent class, though it is exposed if you inherit in blueprints.
ActorActionUtility.h
image

Are the Supported Classes only intended to be filled from blueprints? If not how would I attempt a c++ approach.

Unless there is a getter or a setter function than you cannot edit this.

I don’t advise this, but it would be possible to inherit from the same subclass ActorActionUtility inherits from, and copycat the action utility class in order to get access to that.

I think the intent for making it private is that it’s meant to be treated as static for any given instance of the class, and never change dynamically.

If you want to modify the engine source, then you could keep this private and make your new class a friend class, or just make this protected and inherit that way.

Thanks for the response. 'tis what I feared, getter returns a const array reference, no setter.
I might try setting it to protected and seeing if the constructor can handle setting the ‘defaults’ the blueprint is able to setup. Looking into the code it seems that the right click menus are set up from the CDO so if I understand correctly, you are right that dyanmic changes to the array would as best be ignored and at world break something.

I’m limited in that I can’t make changes to the engine directly (At least for this task). I’ll move to compiling source for engine and see if that can fairly easily achieve the result when I get a moment to try it out. It seems like a powerful feature, hopefully the property can be set without the need of additional assets in future.