Using a material to make either mesh/texture to face player.

Basically Title, I need a large number of objects to look at the player but unfortunately that kills performance so ive decided to go for a material based approach to allow for instanced static meshes. Any tips on how to make this work?

It would use world position offset, for sure. The rotation might be a bit tricky, I’m wondering about some combination of ‘object orientation’ and ‘dot product’ to lerp the rotation…

In any event, the main thing you would need is the player location.

You could pass this to the material with a material parameter collection.

Ive managed to get the player location into the material but past that im lost on how to rotate it to the correct position. Im busy looking into how the “align mesh to the camera” node works to see if that provides any insight.

1 Like

You can make the object face the player, by hacking this code a bit

Just change the camera location, for the player location.

I think you might not like it though, because it makes the shading on everything look a bit weird, sometimes…