Material colour change based on pawn variable

I’ve just started working with the Generic Shooter project from the market place (which may or may not be relevant to the question) and I’ve been wondering about a specific use for dynamic materials.

What I’m looking for is an actor to appear one colour if it belongs to your team, red if it belongs to the opposing team and white if it does not belong to any team. The actor can be captured, so will change colour accordingly. This project aims to Incorporate split screen, so the actor may/will be rendered as red for player one and blue for player 2, depending on the ‘owner’ of the actor and the teams that the two players are on. How would i approach this in a material graph?

I already have integers for the team that the pawns belong to, as well as a corresponding integer on the capturable object.

You can use either Dynamic Material Instance or Material Parameters Collection for that.