Search code examples
godot

How do I animate Material albedo_color with the Godot animation player?


I'd like to animate the albedo color property of a material using an animation player.

I add an animation track "property track":

enter image description here

I select the material property of the node I want to use:

enter image description here

I add some keyframes and attempt to set the albedo color at each keyframe:

enter image description here

However when I set the albedo color on one keyframe, it changes the albedo color for every keyframe. On a hunch, I made the material at each keyframe unique, but then the animation just switches between each unique material at each keyframe instead of interpolating the albedo_color property.

Is there a way to animate material albedo using an animation player node? Or do I have the wrong approach here? What am I doing wrong?


Solution

  • You are keyframing the material not the albedo of the material, we can see it in your second picture:

    keyframed property

    You could get to the albedo by this approach by editing the property path generated for the track.

    However, the easiest way to accomplish what you want is to go to inspector, with the animation panel open, and you should see a key icon next to every property: key icon. Click the one next to the albedo to keyframe it (it will create a track for it if it does not exist already).