MainActor BP that has ChildActor component that’s using SubActor BP as it’s “Child Actor Class”
SubActor BP has just StaticMesh component that’s using some mesh and matterial override (let’s say Material A).
I’ve noticed that MainActor in my level has different material for some reason, let’s say Material B (no idea how it occurred) - so instance of this actor on the level has different value for the MainActor.ChildActor.SubActor.StaticMesh.OverrideMaterial. Any ideas how I can change it? Is it possible to do from UI without creating some utility blueprint?
When I try to select SubActor in the outliner it appears to be unselectable (demo is below). If there was a way to see it’s details in UI, I assume, it would be possible to change the override material.
or change it in the main actor child actor properties
But it doesn’t work, eh?
Child actors ( in blueprints ) are a pain in the neck, even when they are working. Investigating…
Ok, a slightly less painful way of using child actors, is with interfaces. It turns out, you can set the material with an interface, even from construction
The only difference I have is missing “cast Child actor from Target to Child Actor” node, what’s that? It seems to connect without it and it this node doesn’t appear for me.
Also noticed a weird behaviour - I thought if I set material that way it then this instance of MainActor.ChildActor.SubActor would kind of remember but it seems to be resetting on every construction script tick.
E.g. setup below - it’s writing MainActor variable to the ChildActor.Subactor material. But if I stop doing this every construction script tick, ChildActor.SubActor material will reset to the default. Kind of unexpected - I thought this material value is stored somewhere as this instance value in level but turned out it’s always falling back to default if not persistently set to something else.
I understand, just was expecting Subactor’s attribute to act as main actor’s attribute - stored in the level instead of resetting to default every tick.