Search code examples
c#unity-game-enginegame-engine

How can I add a GameObject, such as a Directional Light, in Unity?


I am new to Unity and currently developing a 3D game. I am facing challenges with adding and controlling GameObjects, specifically a Directional Light.

I was able to successfully add a Directional Light to the scene, but I am struggling to control its properties (e.g., intensity, color, rotation, etc.). I'm not sure what I might be doing wrong or if I am missing any steps to properly manipulate the Directional Light.

Could someone guide me on how to add a Directional Light to the scene and provide advice on how to control its properties effectively? Any tips or best practices would be greatly appreciated. Thank you!


Solution

  • Place some objects on the scene that cast a shadow (for example a cube) and try to rotate the directional light. If the scene changes, then everything is working correctly.

    enter image description here