Is there a way to make sure the directional light for a scene is where the skybox's "sun" is? Thanks.
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;
}
}
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.