Texture Mapping - Gradient Doesn't Move With Model


I’m getting to the rigging stage of making this character, and something about one of my materials is getting messed up when I move her.

Her eye’s material has a gradient that controls what part of her cornea is opaque black and what part is transparent. It’s supposed to be completely opaque at the top and gradually become transparent at the bottom so the iris can show through. However, when I move the character the gradient doesn’t follow the model. It gets mapped to the cornea on a global level rather than moving with the object.

I’ve attached screenshots of what it’s supposed to look like in her default position, and a shot of what happens when I move her. I included the section of my shader nodes that control how the gradient is generated. Can anyone help me figure out how to make the mapping stay consistent while the object moves?


You’re using object coordinates. And, presumably, you’re using an armature for your model. The armature doesn’t change your object coordinates. So while your model moves, the texture space is still.

Make an empty. Give it the same world space orientation as your model. Change your object coordinates to use object coordinates from that empty. Parent your empty to a bone. (Probably, your head bone.)