Color changes?

So I wanted to make an object that has a “rainbow” effect, but I cannot seem to get it to work… I tried just simply animating the diffuse color to cycle through, but no luck… Do you guys know how to get this to work?

GLSL or Multitexture?

GLSL would be nice…

Ok, so, if you ever need, multitexture should work with your method, or changing the object colour. However, personally, I use GLSL, as do you, I presume. So for GLSL, change a lamps emission colour to cast different colours. Set it to “Same layer only” and put it in 2. Put the object in 1 and 2 as well.

ColorChange.blend (522 KB)

So I cannot change the color for the object itself? Darn, well this will work for what I’m wanting, so thanks.

You can change the color of an object by animating the Color attribute in the Object tab. (Or in Python change KX_GameObject.color). Only materials with Object Color enabled (in the Material Tab) will be affected. Only one problem with this technique is that the Object Color will be added to the Material Color, so if the Material Color would be black, Object Color won’t be able to influence the overall color. That’s why you should make all materials to be pure white and let Object Color take over completely.

Thank you! As an alternative, do you know how I could make a light only cast on one object?

Perhaps if you would use the ‘This Layer Only’ option in the Object Data Tab of the lamp, with the preferred object in the same layer, and the rest not in the same layer. I’ve never tested this, but I guess it should work.

Edit: just tested this and this works.

How would the object render in-game?

I’m not sure what you mean.

Edit: Maybe this can help. The Cube is on the second layer and so not affected by the Hemi lamp.

Attachments

Lamp_this_layer_only.blend (79.2 KB)

In my game, objects in other layers don’t appear in the game when played, so how did you get this to work?

Shift select the layers you want to highlight them. The Highlighted ones will appear in game.

Oh, I assumed that wouldn’t keep when compiled, but okay. Thanks!

Well thanks to you all, I did it! https://www.youtube.com/watch?v=d7YLrrbg1jo