A simple script that attached to a GameObject in the Hierarchy:

First the variable in the editor in the inspector of the script Speed Change Wait was highlighted I mean it's much black painted then the rest.

Then when I changed or changing other variables values in the editor in the inspector they are also become more black painted. In the screenshot the Headers like Door Init or Door Moves should be in black and painted more then the rest. But now also the other variables like this. I can't figure out why.

For example Random Speed Range is not yet in highlighted black but once I will change it's value it will too.


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GateControl : MonoBehaviour
    [Header("Door Init")]

    public Transform door;

    [Header("Door Moves")]

    public float doorMovingLength = 64f;

    [Header("Door Speed")]

    public float constantDoorSpeed = 1f;
    public float currentDoorSpeed;

    [Header("Door Random")]

    public bool randomDoorSpeed = false;
    public int speedChangeWait = 7;
    [Range(0.3f, 10)]
    public float randomSpeedRange;

    private Vector3 originalDoorPosition;
    private bool isRising = true;
    private float fraq = 0;
    private float timer = 0;

    // Use this for initialization
    void Start()
        originalDoorPosition = door.position;

    // Update is called once per frame
    void Update()
        if (isRising)
            fraq += Time.deltaTime * currentDoorSpeed;
            fraq -= Time.deltaTime * currentDoorSpeed;

        if (fraq >= 1)
            isRising = false;
        if (fraq <= 0)
            isRising = true;

        fraq = Mathf.Clamp(fraq, 0, 1);

        door.position = Vector3.Lerp(originalDoorPosition,
            new Vector3(originalDoorPosition.x, originalDoorPosition.y, doorMovingLength),

    IEnumerator DoorSpeedWaitForSeconds()
        timer = 0;

        while (true)
            if (randomDoorSpeed == true && randomSpeedRange > 0.3f)
                currentDoorSpeed = Random.Range(0.3f, randomSpeedRange);

            if (!randomDoorSpeed)
                currentDoorSpeed = constantDoorSpeed;//reset back to original value

            while (timer < speedChangeWait) { timer += Time.deltaTime; yield return null; }
            timer = 0;

    #if UNITY_EDITOR // make OnValidate() only exist in Editor mode
    private void OnValidate()
        timer = 0;

2 Answers 2


The hightlight indicates that the values are not the default values of the prefab but are specific to this instance. If you want to apply these changes to your prefab you can press "Appply" on the top of the editor and the values will no longer be highlighted since they became the default value of the prefab.

You can read this sentence in the Prefab Documentation :

To make it clear when a property has been overridden, it is shown in the inspector with its name label in boldface.

  • \$\begingroup\$ I understand it now. But then what meaning there is for the headers attributes if they are also bolded like the properties ? At least in my logic it wasn't suppose to get bold when changing the value of a variable in the inspector if you are using headers.Or at least the headers should be in other color/s then bold black. \$\endgroup\$
    – Daniel Lip
    Jul 31, 2018 at 15:55
  • 1
    \$\begingroup\$ @BenziAvrumi that sounds like a UI styling question to ask the Unity developers who chose boldface black for the headers. It might have no better answer than "we liked the way it looked" though. ;) \$\endgroup\$
    – DMGregory
    Jul 31, 2018 at 18:46

The highlight indicates that that value is not at it's default value.

As I recall there's a right click option to reset it to the default value. It is purely there as a visual aid.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .