Editing an Actor's base color in C++

Sorry, I was a bit hasty reading your question.

Each type of component generally has its own set of functions that you can use to modify it in C++. In this specific instance we are modifying a skeletal mesh’s subcomponent’s material, so the application is indeed very specific. For everything you do in UE4 with C++, the best place to check how things are done is the API - it lists all the relevant functions for your specific type of component.

Say you want to manipulate the transform of a component that’s part of your actor. In your actor’s C++ class you need to declare all the components that are part of it if you want to easily manipulate them. Once you have declared them in your .h, you know what the variable is called and most importantly what class it is. Then you can start applying transform changes by using functions for that class. All actor components that have a transform are either USceneComponents or one of its subclasses. There are a lot of classes derived from that, but you would basically be using this class’s functions to manipulate your actor’s component. If you check the API here there is a function called AddLocalTransform. This would add a transform to the component relative to your actor - ie. it would still move with your character but would be either rotated, scaled or positioned a bit differently.

USceneComponent API is where I usually start if I need to do something to a component in C++. Remember, that if you want to manipulate the component, it is wiser to declare it in C++ and not add it in the editor as a subcomponent. While this is entirely possible to do, it’s needlessly complicated and like you said, you need to use FindComponentByClass() functions and whatnot. Even if you don’t apply an actual mesh as the subcomponent in the C++, you want to declare it.