Changing Actor Colors

Assuming both my player pawn and my blocks have transparency in the sprites, how can I change their color on the fly through the blueprint?

Here are two example scenarios I’m trying to achieve:

  1. How can I change my player pawn’s color based on what key I press?

  2. How can I create a block blueprint, which I can then create colored blocks from? Ex: Drag block into world, then change a value, which changes the color of the block. This color should also be able to be read from other functions/blueprints (or have a variable that represents it, which can).

Thanks!

You need a dynamic material instance that updates in the construction scripts based on the linear colour variable you supply. Have a look at the YouTube tutorial: Intro to Materials: Dynamic Material Instances cont. | 10 | v4.0 Tutorial Series | Unreal Engine - YouTube

1 Like

This helped with a lot of it, but unfortunately, it doesn’t seem to work with the 2D Sprite character. I set it up the same way and set it to change the Vertex Color, but it didn’t change in game.

Are you able to get it working for the default sprite actor in the 2D Paper Sprite demo included in UE?