changing object color errors

im making a game where i need to dinamically change the color of objects(for example, turn enemies red and friendlies green), when i was making the game and i was using cubes for everything it worked nice, and i was using something like the following code

green = [0.0, 1.0, 0.0, 1.0]
red = [1.0, 0.0, 0.0, 1.0]
blue = [0.0, 0.0, 1.0, 1.0]

own.color = blue

but then i added the real models, and it didnt work anymore, i came to the conclusion that this is happening due to the materials in the models, because if i remove the materials the colors work fine again, so how can i change the objects color without having to remove the material?

In the material setting, check the ‘object color’ checkbox.

tried it and it didnt work :/, i tried removing the texture from the material and it works, but the model looses its texture

You need to disable “color” influence at the bottom of the texture panel, crank it down a bit, or change the blend type from “mix” to something else.

Multiply is probably what you’re looking for, or is the closest to it. Ensure the diffuse color of the material is white so that the colors don’t get darker than your texture indicates they should.

well, nothing of that worked, i tried every posible thing in the texture panel and nothing worked as i wanted, so i tried switching to GLSL and it worked, it must be some kind of bug with multitexture, i will have to move to GLSL and disable everything i dont use like nodes and stuff, thanks anyway!

Ahh, that’s the key thing. Multitexture doesn’t like overlaying textures/colors on each other. Not really a bug, just a design limitation.