# Get instance x, y, z rotation angle in shader 

**URL:** <https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983>\
**Category:** Rendering\
**Tags:** unreal-engine, question\
**Created:** [February 28, 2025, 7:24pm UTC](https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983 "2025-02-28T19:24:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cubeap](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cubeap/32/1160640_2.png) [@Cubeap](https://forums.unrealengine.com/u/Cubeap)\
**Post date:** [February 28, 2025, 7:24pm UTC](https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983/1 "2025-02-28T19:24:30Z")

</div>

[Here](https://forums.unrealengine.com/t/get-actor-x-y-z-rotation-angle-in-shader/155362) you can see how to extract the rotation of the object itself. But I couldn’t find in the shaders of the engine how to get the rotation for each instance in ISM.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2025, 7:41pm UTC](https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983/2 "2025-02-28T19:41:15Z")

</div>

Do you mean the ‘object orientation’ node?

You might be able to convert that with a ‘transform vector’ ( you can go from world to instance space, I think…? ( not at a machine ) )

---

<div class="post-metadata">

**Author:** ![Cubeap](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cubeap/32/1160640_2.png) [@Cubeap](https://forums.unrealengine.com/u/Cubeap)\
**Post date:** [February 28, 2025, 8:38pm UTC](https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983/3 "2025-02-28T20:38:06Z")

</div>

No, ObjectOrientation is not exactly what I’m looking for.

In the previous question, a similar issue was solved by creating a custom shader with this line:

> float3x3 WtoL = LWCToFloat(GetPrimitiveData(Parameters.PrimitiveId).WorldToLocal);

And then the necessary transformations are calculated. But it doesn’t work for ISM. I couldn’t find how to rewrite this line inside the UE shaders. Trying to simply insert the Transform node after the custom node does not give results.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 28, 2025, 9:14pm UTC](https://forums.unrealengine.com/t/get-instance-x-y-z-rotation-angle-in-shader/2364983/4 "2025-02-28T21:14:09Z")

</div>

Yes, not sure, sorry. But did see this/

> [@Can I get the Instance Orientation in a material?](https://forums.unrealengine.com/t/can-i-get-the-instance-orientation-in-a-material/1310852):
>
> Hi all! I have the following piece of material: In it, you can see the “ObjectOrientation” node. It makes the material work fine for normal static meshes, but when i use it on an instanced static mesh, it does not work… Is there a way to get the Instance’s orientation?
