0
$\begingroup$

Example: A character is using default material, but I want after he has lost half his life, change his material to one with blood, with dirt, or if he is causing the character to change color like the Hulk, like me would you do to switch textures?

$\endgroup$

1 Answer 1

1
$\begingroup$

One sloppy logic-block way is to make a duplicate of your character model, put it on a hidden layer, then use the Edit Object actuator and Replace Mesh drop down option. The hidden layer character model will have your alternate material (texture included).

ad: I say sloppy because if you do this as a programmatic alternative, you're gonna have a hidden layer full of alternate materialed copies of one object. And that could wreck memory allocation as all those materials get loaded into memory.

Programmatically, if you wanna take the time, the KX_BlenderMaterial python object is a much cleaner way of swapping materials. look for the blender 2.78 or 2.79 api docs. It has an example of mixing textures, but you might be able to puzzle it out. (https://docs.blender.org/api/2.79/#) I would suggest downloading the zip so you always have it.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .