How to override all materials in scene on BeginPlay?

So I want to do this little test, where I override all materials on all scene objects on BeginPlay, to test performance between using a really simple material vs expensive materials.

For Static Meshes, it’s easy, but I’m having a hard time replacing materials on our custom Blueprint classes. I get all Child Actors in Blueprint, then cast to a StaticMeshActor, and get the StaticMesh, then replace all Materials on said StaticMesh with the cheap one, but it doesn’t work.

Is there an easier way of doing this?


Never mind, got it working by getting AllComponentsOfClass instead :slight_smile: