# World based UV coordinates for texture

**URL:** <https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256>\
**Category:** Rendering\
**Tags:** uv, laser, unreal-engine, question\
**Created:** [September 12, 2019, 8:00pm UTC](https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256 "2019-09-12T20:00:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikegarn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mikegarn](https://forums.unrealengine.com/u/mikegarn)\
**Post date:** [September 12, 2019, 8:00pm UTC](https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256/1 "2019-09-12T20:00:41Z")

</div>

I’ve needed a solution to this on several different occasions. Right now I’m building a laser sight that is a 1 pixel sprite that scales based on the distance from the weapon to the wall. I want to add a smokey opacity effect to the sprite, but as it scales the smokey texture scales too. How can I set the textures UVs to a world coordinate that isn’t affected by the **sprites scale** or the **camera distance or focal distance**? Thanks for any help in advance!

Here’s where I’m currently at with it without any smokey opacity:

 ![287122-2019-09-12-12-45-08.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/b/80b114d194577a6eacf72afa08e0adf5d58d2a3c.jpeg)

---

<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:** [September 13, 2019, 12:50pm UTC](https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256/2 "2019-09-13T12:50:40Z")

</div>

Have you tried it with the sprite attached to a billboard?:

> **[How to make object be the same size on any distance?](https://forums.unrealengine.com/questions/56284/how-to-make-object-be-the-same-size-on-any-distanc.html)**
>
> How to make object (Actor) be the same size on any distance?

Also, maybe separate the smoke from the ray.

---

<div class="post-metadata">

**Author:** ![mikegarn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mikegarn](https://forums.unrealengine.com/u/mikegarn)\
**Post date:** [September 13, 2019, 6:02pm UTC](https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256/3 "2019-09-13T18:02:35Z")

</div>

This YouTube Video solved my problem. I learned how the “World Position” node works and that did exactly what I wanted.

 ![287243-2019-09-13-10-55-57.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/2/cc21d38e648faf235ba1a9676899cd62ce0b9a0c.jpeg)

 ![287244-2019-09-13-10-57-40.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/a/0ca2ee505d1a764ad3dc88001c24e92257a84fdb.jpeg)

---

<div class="post-metadata">

**Author:** ![mikegarn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mikegarn](https://forums.unrealengine.com/u/mikegarn)\
**Post date:** [September 13, 2019, 6:03pm UTC](https://forums.unrealengine.com/t/world-based-uv-coordinates-for-texture/455256/4 "2019-09-13T18:03:36Z")

</div>

Thanks for the help. I found the exact solution I needed and posted it here.
