How to change character color?

Hi All, I’m working on a third person template with the ball mesh ( from the rolling template ) as my character.

What i want to do now is roll through a trigger volume and change the color of my ball character. How can i do create this in blueprints?

Add vector parameter to mesh material. It will be color parameter.
In construction script create dynamic material instance from that material, store in variable, and assign it on mesh.
Now you can access this material by variable (reference).
When you need to change its color, call SetVectorParameter with this reference and name of vector parameter.

Ok i got the dynamic material setup, now how do i change the color of my character. Is it in level blueprint or character blueprint? Can you show this in blueprint?

Anywhere it suits you, you can do it anywhere, best would be if you would make functions in character that controls it’s color which can be called elsewhere. Level Blueprint should be used exclusively for level scripting, code exclusive for the level.

If color represents state of a ball, best place for setting called would be character

Thanks for the reply, i will do this in the character blueprint. Now the thing is i know how to create a function but i don’t know what nodes to use for controll over the characters color. Can you point me in the right direction?

I think the best way is to create special actor.

It will have box or sphere collision primitive, and editable variable “new color” of linear color type.

Then use its begin overlap event, cast to your player character class, get ref to dyn mat inst and set its “color” param value from “new color”

So it will be like actor that you place in level, set color you want, and it will do everything by itself.

Ah man thank you so much, finally it works! Thank you for the solution, i can change the colors of my character now :slight_smile:

Here is a tutorial on how to change individual components of a texture file on your character or object. I go through changing the color of both your overall single material or individual components as needed: