- Home /
Sun shafts from the sun
I have a scene with a skybox, and a directional light that is oriented the same as the sun on the skybox. I have the camera set up to use Sun Shafts, but I have no idea what to put for the transform. I want the sun shafts to come from the sun, but that is theoretically in-game miles away. I had an idea to position the directional light as far out in the direction of the sun as possible, to try and get close to the position of the sun, but that is far from accurate and frankly doesn't look very good. What should I do about this?
Answer by syclamoth · Jan 01, 2012 at 05:06 AM
If you want the sun transform to always be at the same position relative to the player, you could use some scripting that makes the position always relative to the camera. This way, it makes sure that the rays will always look like they are coming from 'infinity', and it also keeps the rays in the right position!
Your answer
![](https://koobas.hobune.stream/wayback/20220613062544im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Sun coordination with Skybox 2 Answers
Rendering sun-shafts even when light is not in view. 0 Answers
Adding a sun source to HDRI sky 0 Answers
How do I create a moving cookie texture for a directional light? 2 Answers
shafts of light in fog? 3 Answers