Question: How do I animate a handful of simple characters faces using textures

Hey,

Got a question about animating a simple character face using textures.
So I am working on very simple game. Which is turning out to be not so simple at all.

Basically my characters’ are a series of blocks haphazardly rigged together.
I would like to animate one polygon face on the character to express certain states (Tired, emotions, actions, etc.)

Anyway - I would like to swap out textures based on actions and states that the main character

For example -

If a character state is tired it will swap out for the tired material.

If a character is taking an action like punching a hard object (Tree for example). It should swap out for the pain material.

Now here goes the question - How do I do this?

I am not looking to use blend shapes but materials, Material functions, Blueprints and possibly anim montage.

Thanks for your time

  • HeadClot

PS. If I posted this in the wrong section feel free to move it.

If you’ve got a block for a head, you could just add a static mesh plane in front of it, and use opacity masked materials and change the material or a texture parameter of the material to whatever state of the face you need. Or if you want it to be animated, you could use a flipbook instead of the plane.

I believe the solution you are looking for can be found here:

https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/MaterialInstances/index.html#materialinstancedynamic

“Material Instance Dynamic:”

“…the possible applications for this are endless, from showing different levels of damage to changing a paint job to blending in different skin textures in response to facial expressions.”

's right – you need to make some dynamic material instances. Here’s what I do:

First, I set up a DMI of my character’s head material in the Construction Script:

Well, actually that won’t even work if you don’t establish the “Texture” parameter in your original material. Let’s assume you did, though. Whenever I want to change my character’s expression I call a tiny function:

Whenever I call this function I swap in whatever expression I want. For instance, here’s a look at making the character blink:

After a random amount of time I switch to the blinking texture, wait 0.2 seconds and switch back to whatever he had going on before.

I’m working with still textures, but I imagine it wouldn’t be too hard to set up animated textures using Flipbooks. You could make the number of frames per animation a parameter and change that depending on the animation you want to play.

1 Like