Announcement

Collapse
No announcement yet.

Set Material Colour Easily (using variable?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Material Colour Easily (using variable?)

    Hello,

    So I'm making a game with a very simple art style. No models have any textures - just different colours. The way I've been doing this is by making a different material for each colour I use. However, I know in Unity there's a way to change the colour of each material channel of a model (or blueprint actor) however you wish through use of a colour variable, rather than using a different material every time. Does anyone know how to achieve this? Thanks for any help!
    Last edited by Andrew Lindsay; 12-18-2018, 07:20 AM.

    #2
    Add this kind of for character.
    Code:
    if (USkeletalMeshComponent* m = this->GetSkeletalMeshComponent())
    {
       m->SetVectorParameterValueOnMaterials(FName(TEXT("Color")), FVector(1.f, 0.f, 1.f););
    }
    Then make material that has VectorParameter named "Color".

    Comment

    Working...
    X