Need Help Making Gradual Color Change

Ok, so the main area I intend to use this in is for buttons on the menus of my games, with the color change showing which button the user’s mouse pointer is over. However, I don’t want the change to be instantaneous (which I already know how to do :D). I want it to sort of fade from the original color to the “active” color.

Any help is greatly appreciated.

You could set the object color with python and interpolate between the start and end values. Otherwise, use an animation action for the color, playing it back on mouseover

I agree a material or object color Action is the way to go.

Let it play in flipper mode to act as “hover” animation.

How would you do an animation action for color? Thinking about it, this definitely seems to be the way to go, but I can’t seem to figure out how to do it.

Press “i” over the color bars. The animation goes to the current objects action.

You have to animate the “OBColor in object data”

Ok, I got the color to change correctly, and it’s exactly what I was trying to do! However, before I start the animation, the object is just white. I can’t seem to figure out why this is happening, so I’ll just post the .blend file.

color change.blend (378 KB)

i think its because the diffuse color in the material tab is still the default color, try changing it to match your blue its r= .08981 g = .118 b = 1.0, maybe someone else would know another way to fix it

The animation is not initializing until you call the Action. To resolve this, add the following logic to the Cube:

Delay: 0 >> OR >> Action: CubeAction.001 - Play - Start 1.00, End 1.00

That will force the Action to initialize.

I would consider this a bug, but I’m not sure how the developers would feel. CubeAction.001 is clearly attached to Cube in the Outliner, and it seems to me that the Game Engine should respect that by initializing the attached action to frame 1 when the scene is loaded. Do you mind if I post your .blend to the bug tracker for consideration?

I think that the diffuse color has to be set to white, or else the object color doesn’t work correctly (when I tried it just know, the object became black with red specular) That was a good idea though, I hadn’t thought of that.

so you’re saying that, if it were functioning as it was designed, what I’m doing should work? Well, that sure makes me happy! That would probably be the first time that Blender has screwed up, and not me :smiley: As for posting it to the bug tracker, by all means, go ahead. I don’t mind at all. Also, your solution should work perfectly. Thank you so much for your help!