Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

(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 :)

Product Version: UE 4.11
more ▼

asked May 29 '16 at 12:27 PM in Blueprint Scripting

avatar image

3 1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered May 30 '16 at 02:22 AM

avatar image

7k 143 28 172

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question