# How to make foliage go transparent in front of camera?

**URL:** <https://forums.unrealengine.com/t/how-to-make-foliage-go-transparent-in-front-of-camera/938922>\
**Category:** World Creation\
**Tags:** unreal-engine, question\
**Created:** [April 14, 2023, 2:41am UTC](https://forums.unrealengine.com/t/how-to-make-foliage-go-transparent-in-front-of-camera/938922 "2023-04-14T02:41:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DayanaS22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DayanaS22](https://forums.unrealengine.com/u/DayanaS22)\
**Post date:** [April 14, 2023, 2:41am UTC](https://forums.unrealengine.com/t/how-to-make-foliage-go-transparent-in-front-of-camera/938922/1 "2023-04-14T02:41:03Z")

</div>

Is there a way for me to make foliage go transparent when in front of the camera? I used the foliage tool and all the trees are meshes. Thank you!

 ![help](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/8/018b446b854dd6f66b8b2132a7820b55f5b61183.jpeg)

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [April 14, 2023, 3:34am UTC](https://forums.unrealengine.com/t/how-to-make-foliage-go-transparent-in-front-of-camera/938922/2 "2023-04-14T03:34:03Z")

</div>

i think you can achieve this at a material level.  
though most probably with a post process material. maybe by writing a custom stencil channel with the playre and then checking if the tree is in front of that.  
you could also literally “make your material transparent in front of the camera” but that literally is everything in the camera. you could check if it’s on the center but it could be far away, or behind the player. so i think the post process is the best.

how exactly, i dont know. check this out. is doing it the other way around but is the same technology.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/e/46e9632bee3db6acec6c79e83b9e6d0092c15421.jpeg "How to Create Masks With the Custom Stencil Buffer | Tips & Tricks | Unreal Engine") ](https://www.youtube.com/watch?v=PiQ_JLJKi0M)

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [April 14, 2023, 11:56am UTC](https://forums.unrealengine.com/t/how-to-make-foliage-go-transparent-in-front-of-camera/938922/3 "2023-04-14T11:56:24Z")

</div>

You want to use the camera vector and a distance value of some sort.  
Check these.

> **[Depth & Location Based Effects | Live Training | Unreal Engine](https://www.youtube.com/live/GXbE0IqbA7w?feature=share)**
>
> Announce Post: https://forums.unrealengine.com/showthread.php?84886Alan Willard discusses different depth and location-based effects, like hiding objects tha...
