CodeBlanks Logo Icon CodeBlanks

Light types

Learn Directional, Point, Spot and Area light types.

Four light types

There are four light types in Unity scenes: Directional, Point, Spot and Area. A Spot light spreads in a cone like a flashlight; a Point light reaches in all directions from a single point like a candle. The light type is decided by the type property of the Light component.

isik.type = LightType.Spot;
isik.type = LightType.Point;

In the examples below, the isik variable represents a Light component.

The character of each type

A Directional light is like the sun; its position does not matter, only its direction, and it sends parallel rays to every object. An Area light gives soft light from a rectangular surface. Choosing the right type for the need of the scene directly affects how it looks.

isik.type = LightType.Directional;
isik.type = LightType.Area;

Each type exists for a different lighting purpose.

Practice Record the light type

In a class named IsikTanimi, define a string tur field with the value "Spot". In the Start method, print the text "Secilen tur: " joined with the tur variable using Debug.Log.

Starter code

Player.cs
using UnityEngine;

public class IsikTanimi : MonoBehaviour
{
    // string tur alanini "Spot" degeriyle tanimla

    void Start()
    {
        // "Secilen tur: " metnini tur degiskeniyle birlestirip yazdir
    }
}

Sample solution

Player.cs
using UnityEngine;

public class IsikTanimi : MonoBehaviour
{
    string tur = "Spot";

    void Start()
    {
        Debug.Log("Secilen tur: " + tur);
    }
}

Expected output

Secilen tur: Spot

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which light type emits light in a cone shape like a flashlight?

  • Spot light Correct answer
  • Area light
  • Directional light
  • Point light

Explanation: A spot light spreads in a cone from a single point; it suits flashlights and directed lamps.

2 Select the point light type

Question
isik.type = LightType.____;
Answer
isik.type = LightType.Point;

Explanation: A point light spreads in all directions from a single point; its name in the LightType list is Point.

3 Light types and their traits

Term Meaning
Directional Parallel rays like the sun
Point Light in all directions like a candle
Spot A cone like a flashlight
Area Soft light from a surface

All lessons in Intermediate