Creating procedural textures for zombies

I have 5 characters with their respective animations and for each of their body materials I have textures of different colours. My wish is that when they appear in the game these textures are applied randomly to each character, so that the same character with the same material looks different from the rest of his clones.

At the moment I’ve only managed to randomise the texture depending on the position of the model. This would be nice if I could stop the changing process at some point, as I can’t do it as soon as the character moves, it changes texture being an absolute chaos.

Anybody have any ideas?

Best regards and thanks in advance.

1 Like

I’d go with the ‘per instance random’ → frac * 4 :slight_smile:

Thank you for answering @ClockworkOcean ! However, although I may have misunderstood you, what you are proposing does not work.

Best regards and thanks

1 Like

No floor :wink:

I had already tried, no change. I suppose it could work if I could “merge actors”(Batch), but they are animated characters.

I’m sorry

1 Like

Ah, you threw me a bit, it would work if they were actually instances…

Gimme a min.

Then you have to go for

and

rand

Or, less pastel colors

Excuse me, but is the last gif you posted the final result? I’m already at that point, my problem is that when the zoobes move around the scenery they constantly change texture, like in your gif. What I need is that they change only once.

Thanks again for your answer and for taking the time.

That’s only because I’m running it in the construction script. Once they’re in the level, it will stay constant…

In general, it’s like this

If you set ‘increment’ around 2, 3 or 4 you get kind of primary colors, any higher, and you get pastels.

1 Like

Hello again,

I’ve tried to reproduce your code but I must be missing something. I don’t know if your code can be implemented if it is a “skeletical mesh comonent”. I’ve tried creating it that way and with a blueprint actor and before setting the random colour, as you can see, it doesn’t seem to affect the object if I make it pink.

On the other hand, forgive me for being such a first timer, but where did you get the “Increment” node?

Best regards

Thank you again for your time.

You need the parameter name :wink:

image

Increment is an integer variable, a good value is 4.

I’m gonna try it with skeletal, but I think it will work… Hmm works fine

1 Like

That was the last piece of information I was missing, YES!!! IT WORKS!!! you don’t know how much I appreciate it, I’ve had this error for days and I thought there was no possible solution:
Vídeo sin título ‐ Hecho con Clipchamp

Lastly, if I can ask for a bit more of your time, how can I do that instead of randomizing colours, it randomizes textures? I think this is a good start but I don’t know how to set up a “noso” that, depending on a number, as with the vector colour, selects one texture or another in a “switch”.


My attempts don’t work, I must be too rough XD

Thank you very, very much, you are my angel @ClockworkOcean

1 Like

Very similar, except you make the material like this

and the BP like this

It’s just an array of textures

( You can have a more complex material, of course, but this is how you switch textures )

1 Like

That idea is fantastic! but I can’t find the “Texture” variable, again I’m a first timer, how did you get it? @ClockworkOcean


I can’t seem to join that node with the “random” node if it is not exactly the variable “texture”.

image

Then you have to pull from the array variable, and search for the random node.

1 Like

Thank you!!, that was it. However, I am not able to get it to work for some reason.

However, with the previous option you gave me for the vector colour, I have managed to get the black colour parameter to work as a random element and this method suits me better.

I don’t know if you can think of a reason why the last method doesn’t work, but if you want I can close the subject/question of forums-unrealengine by answering your first code.

You don’t have a texture parameter in the material, you can only talk from the blueprint to a ‘parameter’ :slight_smile:

Also, you don’t do the texture choosing in the material now. No switch there. ONE texture, and you change it from the blueprint.

Just put one texture in the material and

text param

and in the BP

image

Maybe I am not understanding you, I think I have already done what you are telling me, I have recreated the texture node as a parameter and I have renamed it as you did; but no change happens.


If it’s a cube, it only has one material, so this would be a zero

I only used 1 in my example, because I was dealing with the third person mesh, which has two materials.

image

1 Like

IT WAS THAT!!! You’re great, thank you so much. I’m going to close the subject. Now I have even don ways to get the result; Thank you very much @ClockworkOcean

1 Like