Unity Basics
  • Welcome
  • Getting Started with Unity Software
  • Helpful Shortcuts
  • The Unity Software Interface
    • The Default Interface
    • The Windows (Tabs)
      • Hierarchy Window
      • Scene Window
      • Project Window
      • Inspector Window
      • Game Window
      • Console Window
    • Other Layouts
      • Create a Custom Layout
  • Create
    • Creating Game Objects
      • 3D Primitives
      • Creating Game Objects in the Editor
      • Spawning Objects
      • Unhiding/Hiding Objects During Gameplay
      • Parenting
    • Creating Assets
    • Creating Components and Scripts
      • Adding Components in the Inspector
      • Creating Custom Components and Scripts
    • Creating Prefabs
  • Select and Update
    • General Selection
    • Search and Focus
    • Updating Game Objects
      • Updating Game Objects in the Editor
      • Updating Prefabs
    • Updating Assets
    • Updating Components
      • Update Components in the Inspector
      • Accessing Components Through Scripts
  • Delete
    • Deleting Game Objects
      • Deleting and Disabling Objects in the Editor
      • Using the Destroy() Function
    • Deleting Components and Scripts
      • Disabling and Removing Components in the Editor
      • Disabling and Removing Components During Gameplay
  • Translate, Rotate, and Scale
    • Intro to Transforms
    • Handy Transform Shortcuts
    • Translate
      • Positioning Game Objects in the Editor
      • Updating Position Through Script Code
      • Using the Transform.Translate() Function
    • Rotate
      • Rotating Game Objects in the Editor
      • Updating Rotation Through Script Code
      • Using the Transform.Rotate() Function
    • Scale
      • Resizing/Scaling Objects in the Editor
      • Updating Scale Through Script Code
    • Controlling Speed
    • Common Issues with Transforms
  • Materials
    • Material Basics
      • Creating and Applying Materials
      • Accessing Materials Through Code
  • Physics
    • Physics Basics
    • Colliders and Triggers
      • Collider Component Overview
      • Accessing Colliders Through Scripts
      • Common Issues: Colliders and Triggers
    • Rigidbody Component
      • Rigidbody Component Overview
      • Accessing the Rigidbody Component Through Scripts
      • Common Issues: Rigidbody Components
    • Common Issues: Physics and Velocity
  • Interaction
    • Interaction Basics
    • Keyboard Controls
    • Mouse Controls
  • Coding Basics
    • Intro to Scripts
    • Variables
    • Conditionals (If / Then / Else)
    • Arrays
    • Loops
    • Functions
Powered by GitBook
On this page
  • Overview
  • Number Fields
  • Object Fields
  • Checkboxes
  • Dropdown Menus
  • Color Picker

Was this helpful?

  1. Select and Update
  2. Updating Components

Update Components in the Inspector

PreviousUpdating ComponentsNextAccessing Components Through Scripts

Last updated 4 years ago

Was this helpful?

Overview

When you select a game object in the Hierarchy or an asset in the Project window, the components that control the behavior and appearance are listed in the Inspector.

The white fields are editable.

Changes made while in Play Mode will revert back to the values before playing.

You can copy the component and its values in Play Mode, then paste the values or as a new component when no longer in Play Mode.

Number Fields

These fields uses integers and floating point numbers.

You can type directly into the field. Press Enter or click off the field to confirm.

For number fields, you can also hover your cursor over the label (eg. x, y, or z) to show a double arrow symbol. Click and drag it left or right to adjust the value incrementally.

Some of these are displayed as specific ranges with a slider.

Object Fields

These fields will often be "None" for their default followed by the type of component it is looking for.

There are two ways to update these in the Inspector:

  1. Click and drag objects from the Hierarchy or Project window into the field

  2. Click on the circle/target icon to the right of the field for a list of objects and assets that match the required type.

If there is a reference an object in the script and the Inspector field is empty and the script doesn't assign the variable, you will get a common error:

UnassignedReferenceException: The variable _____ of _____ has not been assigned. You probably need to assign the _____ variable of the _____ script in the inspector.

Checkboxes

Checkboxes are fields that use booleans (true or false, 1 or 0).

Check for TRUE. Uncheck for FALSE.

These fields are great for custom scripts to see if parts of scripts are acting in a specific way (yes they are or no they aren't) and when you want to test how something would behave under different switch-like circumstances.

Dropdown Menus

These are fields with a set list of choices where you can only use one at a time. Click to expand and select the desired value.

Color Picker

These appear as a color box.

Click the dropper icon to select a color visible on the screen.

Click on the swatch to open the Color window. Select the hue you want from the outer ring, then the value of the color (lightness/darkness/tint) in the square.

RGBA (red, green, blue, and alpha) values can be added manually in the number fields. Alpha controls the opacity, but only some Materials can be transparent.

Although the default is RGB 0-1.0, there are other options in the dropdown:

Note: HSV stands for Hue, Saturation, and Value and is another way that uses numerical values to create a visual color.

The Hexadecimal field will translate "Hex Codes" often used in web development that are six-digit codes starting with a hashtag # with each digit ranging from 0-9 or A-E.

Close the color window when you are done.

Deleting and Disabling Objects in the Editor
Adding Components in the Inspector
Example of components of a newly added Sphere game object.
Example of updating the Transform component