x


Before updating to Windows 10 you may need to return your Pro license. More information here

Sun coordination with Skybox

Is there a way to make sure the directional light for a scene is where the skybox's "sun" is? Thanks.

more ▼

asked Oct 06, 2010 at 12:34 AM

avatar image

Mentalist4006
150 53 42 52

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You'll have to do it manually by positioning the directional light where the "sun" should appear to be for the player. The good thing is that the directional light can be outside the playable area so that it always appears to be in the same place as the sun in the skybox. Turning on your sky in the scene view can help you align it properly.

more ▼

answered Oct 06, 2010 at 04:12 AM

avatar image

Adam Rademacher
1.3k 4 9 31

(comments are locked)
10|3000 characters needed characters left
 using UnityEngine;
 using UnityEditor;
 
 public class DirectionHelper : Editor
 {
     [MenuItem("Healpers/SetLightDirection")]
     static void SetDirection()
     {
         Transform selected = Selection.transforms[0];
         if(!selected)return;
         selected.forward = -SceneView.lastActiveSceneView.camera.transform.forward;
     }
 }

Instruction

more ▼

answered Sep 06, 2012 at 01:27 PM

avatar image

mouurusai
527 3 10 14

This worked wonderfully for me. Much easier then setting it manually like I was before.

May 09, 2014 at 04:13 AM WyvernSpite
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2743
x807
x356
x44

asked: Oct 06, 2010 at 12:34 AM

Seen: 5888 times

Last Updated: May 09, 2014 at 04:13 AM