Download

How can I have my UVs dependant of the material position?

Hello,

I’m using the material M_Caustics I found on the Cave example to create a caustic effect. I use this material on a spotlight as a light function, and I’ll attach this spotlight above the head of my player (in a Z independant axis).

The problem I’m facing is that when the player moves, my caustics moves too… How can I do so that when the spotlight moves, the UV of the material moves too and so we can’t see that the spotlight is moving ingame?

I know the Panner node can help me on this but I can’t find out how to make it work.

Here’s the material graph: http://puu.sh/ablI4/e644afc9dd.png

Thanks!