material change while character pass by problem

I’m new to unreal, and I’m creating a game that is similar to endless runner to practice. The scene is set at night. So there would be no light. And I’m imagining that the character/player runs and passes by endless buildings, but the buildings will only light up when the character/player passes by. I’m not sure how to write the script for this function. I’m thinking about something will trigger the material changing? But how to trigger that function is also a question. Is there any related resource or tutorials or just any suggestion for me?

Thanks for any help!!!

Attach a point light to the character pawn and let it light up the world.

IF you want a material change, then you need to write a script that handles calculates the distance between itself and the player by using the GetActorLocation nodes every tick and when close enough apply a new material.

HTH