(Blueprint) Tint mesh material colour on spawn?
So I have an actor I spawn from a blueprint class on a key press and depending on which of two keys is pressed will determine it's (int)team. I would like to tint the colour of the actor depending on its team. E.g. Team 0 actors are slightly blue while team 1 are slightly red.
I'm attempting this is blueprints and thought this would just be like multiplying a textures RGB values but I couldn't manage to access the material/texture in blue prints.
For reference the mesh is specifically the 'sk_CharM_Base' from the Infinity Blade: Warriors content pack by Epic Games that I'm trying to colour.
Thanks in advance :)
asked May 29 '16 at 12:27 PM in Blueprint Scripting
Expose the Team int on Spawn (of the Actor you want to Tint) so you can easily set it in the Spawn Node (See picture) https://gyazo.com/9df9b066b8ba77ff30476cce80d41294
On Beginn play Create a Dynamic Material Instance. Input the Mesh you want to tint and the index of the Material. Use the Material you already got on your Mesh. Switch on int Add 2 more pins (or even more if you got more teams) than you Set a Vector Parameter (RGBA Color) on the Material. Set the Parameter Name correctly like you have it in your Material. https://gyazo.com/7c6b786094bc79c14e6120a6de1de05c
In your Material Create a Vector Parameter and name it Correctly. Thats the Value that comes from your BP do with it whatever you like I simply put it into Color you can Multiply it or whatever up to you =) https://gyazo.com/9751a82aa1bd1786a3b92afebbf880da
answered May 30 '16 at 02:22 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here