Paint cube with collision in GLSL is not working

Hi, i´m trying with a collision sensor give a color to my cube. when collides paint with red color. but is just working with Multitexture Mode, but i want to make it in GLSL. Someone know how to make this?
Here is my problem:


colorGLSL.blend (735 KB)

Check Object Color in material settings, it won’t work with that. However, there is a syntax problem in your script which applies the color- it is glitchy this way and looks more black, use different type of syntax, I’ll post fixed .blend later if I can!

Yes i did that before in multitexture and worked fine for me.but now in glsl doesnt work…

Well changing colors in your game works.

I would think that there is a bug in your game logic.
It is most likely your collision check that doesn’t work.
Put some debug print() in your if statements to see whether they even start.

Yeah, and note that you need to check “Object Color” in material settings for them to work, it’s a rule in GLSL!

Thank you all. It works :slight_smile: