# Transparent(invisible) Cube that casts shadows

**URL:** https://discussions.unity.com/t/transparent-invisible-cube-that-casts-shadows/61210
**Category:** Questions & Answers
**Created:** [January 23, 2013, 12:10am UTC](https://discussions.unity.com/t/transparent-invisible-cube-that-casts-shadows/61210 "2013-01-23T00:10:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BDV](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/bdv/32/581252_2.png) [@BDV](https://discussions.unity.com/u/BDV)
#### Post date: [January 23, 2013, 12:10am UTC](https://discussions.unity.com/t/transparent-invisible-cube-that-casts-shadows/61210/1 "2013-01-23T00:10:11Z")

</div>

Hi guys , i need to create some objects (cubes) that will block spotlight and cast shadows on other objects , but during the game … they shouldnt be visible … is that possible ???

---

<div class="post-metadata">

### Author: ![Bunny83](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@Bunny83](https://discussions.unity.com/u/Bunny83)
#### Post date: [January 23, 2013, 12:16am UTC](https://discussions.unity.com/t/transparent-invisible-cube-that-casts-shadows/61210/2 "2013-01-23T00:16:14Z")

</div>

Yes, that shouldn’t be a problem 😉 All you need is a shader that is classified as opaque shader by Unity but that doesn’t render into the color buffer. However it has to be rendered into the depth buffer. To prevent the cube (which is “opaque”) from blocking the view to things behind it, you have to put the shader on a render queue after the normal geometry.

That’s all just a theory 😉 You have to try it. The [DepthMask shader](http://wiki.unity3d.com/index.php?title=DepthMask) might be a good start

---

<div class="post-metadata">

### Author: ![temptest123](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@temptest123](https://discussions.unity.com/u/temptest123)
#### Post date: [January 23, 2013, 4:06am UTC](https://discussions.unity.com/t/transparent-invisible-cube-that-casts-shadows/61210/3 "2013-01-23T04:06:32Z")

</div>

check this:

> **[Having an Invisible Object that Casts Realtime Shadows. - Unity Answers](https://answers.unity.com/questions/269292/having-an-invisible-object-that-casts-shadows.html)**
>
> Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
