How to center a texture using objectPositionWS

Try something like this. It will work for XY projection. Also I think you can calculate Size by 1/ObjectRadius or one of options in ObjectBounds.

Offset parameter added to make additional adjustments for ‘relative texture location’.

Thanks, it does center the texture perfectly when I offset it by 50,50,0,1.

To addapt the size I tryed to use radius to scale it whith no success. Using OptionBounds just make UE4 chrash…

You want to change its size in game?

If not, just set size values manually.

If yes - you can try to multiply size parameter on ObjectScale, and set size values manually also.

You can adjust size manually, by measuring object size in editor.

With rotation this setup will not work.

Hi, I have a mesh with bad UV mapping. The texture and the mesh have to be cocentric. I want this to be automatic so I don’t have offset the texture manualy.

My idea is to use the worldAlignedTexture node to bypass the UV problem.
I want the center of my texture to be at the center of the bounds. I think Ihave to use the objectpositionWS node to get the position of the center of the bounds, but I don’t know how to use it in the worldAlignedTexture node.

Has anyone done something similar?

I want the size of the texture to match the size of the object. That way you dont see the white corners.
I also ran into another problem. I tried to rotate the object aroud the y axis and the texture didn’t follow. Not sure it is possible to avoid that though.