You need to use the CreateAndSetMaterialInstanceDynamic -function.
If you download the ShooterGame example, it has a fully functioning system for the colour change in characters. Check out the ShooterCharacter class and in there UpdateTeamColors -function.
Also check this thread, it has a simplified example of the use of the function.