Post Process outline problems

Hello, my problem is the following, I recently created a material for the post-processed effect that puts a border to the elements of my game, but the problem is that I want the border to be of different colors depending on each element, the enemies in red, the stage in white, the protagonist in green, but I don’t know how to do it, does anyone know how?

Have you seen this? Multi-color Outline Post Process in Unreal Engine 4

Thank you, that’s exactly what i need