How to change material of unpaired actor? Probably v simple and easy

Hi there, I’m very new to Unreal so I’m struggling to do something that is probably quite basic. Apologies if I use the wrong terms to describe things! Still learning.

Basically, I have a small AI-directed cube pawn, which spawns at the start of the game and follows the player around every 0.5s. Its material is an emissive white colour. I then have a sphere mesh at the other side of the room, with a large sphere collider. I have a blueprint for this sphere mesh which I want to say “on overlap with the sphere collider, change the material of the cube pawn to blue emissive”.

I already prepared all the material instances so they’re there in the drop-down list.

I tried debugging by just changing the material/colour of the sphere mesh itself, which works. But my problem is when I try to change the material of another object which isn’t paired to the sphere mesh (by this I mean, it’s not a child actor). In case the problem is that the cube pawn is not a child actor of the sphere, I tried adding it as a child component - however not only does this still not change the colour, but it wouldn’t be the initial cube pawn that follows the player around at the beginning - it would be a new instance of this cube pawn.

The above is what I’ve tried - this is a BP on the sphere mesh, and I referenced the mini cube pawn by dragging the mini cube BP into the graph editor (it’s not already in the scene as it’s spawned at the start of the game by the BP).

Any suggestions would be gratefully received - as I said, I’m very new to Unreal so it might be something obvious that I’m not seeing.

If I understood right
Here is my example of how I’m attaching an actor as a component to my pawn
In my case, I’m attaching BP_Gun


And then inside BP_Gun I can freely change the material, in my case I do this if the gun is reloading

In this case i would add logic to the cube itself.
Give the sphere a “tag”( a name to identify these types of objects)
Then from the cube check the overlap drag out from “other actor” for example,
and do a “actor has tag” node, routed into a branch. so it only fires off if the overlap has that tag assigned. And then simply do your material logic from the cube itself.
That way you wont have to cast to anything for a simple material change.
Hope this explanation is enough to get you going :slight_smile: