Mapping gradient texture

Hello all, I am trying to map a gradient so the red is at the tip of the object.
I tried to rotate on Y (then everything else…) with no success. Don’t understand why this isn’t working.
Thank you

No .blend file supplied for review !!

What do your UVs look like ? (you are using the object UVs as the texture coordinates)
Why are you using the mapping node with 45 degrees rotation ?

One option using generated texture coordinates

Your post is missing a .blend so can’t tell.

This one works very well

Thank you will try your solutions. Sorry about the no .blend. I thought it must be such a simple thing that one wasn’t needed.

A quick question so i understand this better. I’d have thought the only thing I’d have needed to change was the rotation. But it seems that the location needs to be specified. I’d have thought it would be located on the z axis as it is a top to bottom gradient.

Thank you

Depends on the texture coordinates used and how the mapping node is set up to do the transformations. For example, generated coordinates cover an object from one corner over the whole thing, while object coordinates put the 0,0 point at object origin and repeat to get the object covered. To get the object coordinates to match generated coordinates, you’d have to move them because the default position doesn’t match.

Of course the default could be changed by either manipulating the texture space with generated coordinates, or object origin with object coordinates.

You’re using UV’s which are custom coordinates and even if you showed the output on the object, the screenshot wouldn’t be enough to know why it behaves like it does. Screenshot in my reply shows the output and shows the viewmodes used, but it’s still useless to you because it doesn’t show how the UV’s are placed, and doesn’t show if the object has unapplied rotations or not.

The thing with a .blend file is very simple: it’s always needed. Learn to prepare one every time you have a question involving one, and there’s a chance to get actual clear answers without guesswork. Throw away irrelevant bits from it, enable compress, and it’s smaller to upload/download than an image.

If the solution is simple, you get a simple and precise answer. But if one has to guess what could cause the problem, it usually means there are at least 5 different things that could cause it, and that’s without getting into too exotic possibilities. I sure as hell won’t spend an evening guessing all 5 and explaining each, producing examples with Blender to make it easier to write, and then receive the infamous “it doesn’t work” at the end. I have better things to do, and if I don’t, I will figure something out after closing the tab.