Download

GetObjectRotation or create CustomInputData to use in material

Hi, I want to manipulate texture rotation with some InputData similar to ObjectOrientation. However ObjectOrientation wont give object rotation around Y axis, and this is what I need. So maybe is another way to get object rotation, maybe something similar to MaterialParameterCollection?

You need forward and right vectors of object orientation.

Then dot product of forward vector and RGB=[1,0,0] will give you cosinus of rotation in degrees. But because cosinus is symmetrical you will not know if its right or left, so you need another dot product with right vector, its SIGN give you information if rotation is to the right or left.

Then from cosinus*sign you can either get degrees or use it directly to change values.

Now if you cannot get object rotation from within material shader, you can supply it as parameter (RGBA vector) from blueprints then component mask to RGB only.

Ps. i am also unsure if RGB=[1,0,0] is forward, never can remember which one is what direction.

Yeah, ok, Im sorry I didn’t mentioned that (in fact I dont know why O_o ), but I don’t want to use parameter because I don’t want to use dynamic material instance.