How to get the forward vector in a material?

The only thing I can find is object orientation and that is only for the up vector. Or am I missing something here?

Setting the forward vector through a dynamic material every tick inside the material would be not a workaround here since that is beside the point of what I’m trying to do.

+1 I have the same question, any progress on this one? :slight_smile:

I ended up importing all the meshes I needed it for rotated in a way so that the forward vector becomes the up vector. It is a silly workaround but as long as you only need the forward vector it works that way.

Why not just local to world transform ?
If you want object X axis as forward, you could do this:

1 Like

This method does not appear to work on instance meshes…

It does, but only in vertex shader( you need to pass the expression on the image above) through interpolator node or custom UV).

don’t forget to normalize the transformed vector, if you want to use it as a rotation axis, since it puts a scaling on the output.