Editing Values¶
Numbers, vectors and colours are edited the same way everywhere in the editor: in the Inspector (the lower half of the Scene Hierarchy panel), in Settings, in the Material Editor and in the Scene Renderer. This page explains how to drag and type values, which arithmetic you can type into a number, and how vector, colour and reference fields work.
In short
Drag left or right on a number to change it. Hold Shift for fine steps or Ctrl for
coarse ones. Click a number to type a new value: arithmetic such as 0.5*3 or sqrt(2)
is worked out when you press Enter or Tab, and Esc cancels. Click the coloured
X, Y or Z badge of a vector to reset that component, right-click a colour to change how it
is shown, and click an asset, entity or script field to pick from a searchable list.
Field types¶
| Field | What it looks like | Examples |
|---|---|---|
| Number field | A box with a number in it. The pointer turns into a left-right arrow over it. | Most numeric properties, such as a light's Intensity. |
| Slider | A number field with a filled bar behind the value, showing where it sits in its range. | Roughness and Metalness in the Material Editor, the Sky Light's Rotation. |
| Stepper | A whole-number box with - and + buttons. | The Length of an array field in a script component. |
| Vector field | Two to four number fields side by side, each with a coloured axis badge. | Translation, Rotation and Scale of the Transform. |
| Colour field | Number fields for the red, green, blue and sometimes alpha components, and a colour swatch. | A light's Radiance. |
| Reference field | A button showing the name of the asset, entity or script the field refers to. | The Script Class of a Script component. |
Number fields¶
Dragging¶
Press on a number field and drag left or right. The value changes in steps that suit the field, and the pointer is hidden while you drag, so you can keep going past the edge of the screen. The field's border is highlighted while you drag.
| Hold while dragging | Effect |
|---|---|
| Nothing | The value changes by the field's normal step. |
| Shift | The drag moves ten times slower and snaps to a step ten times finer. |
| Ctrl | The drag keeps its speed and snaps to a step ten times coarser. |
Fields that hold whole numbers always stay whole, and fields that have a range never leave it.
Typing a value¶
- Click the field without dragging. The current value is selected, ready to be overtyped.
- Type a number or an expression.
- Press Enter, or click elsewhere, to apply it. Press Esc to cancel and keep the old value.
Tab also applies the value, and moves on to the next field. If that is a number field, it opens for typing straight away, so you can fill in a row of values, such as the X, Y and Z of a position, without touching the mouse. Shift+Tab moves back to the previous field.
A typed value is used exactly as you type it, not rounded to the drag step. Whole-number fields round it to the nearest whole number, and fields with a range clamp it to that range. If the text isn't a valid number or expression, the field keeps its old value.
If a number field has keyboard focus, Space or Enter also starts typing.
Sliders¶
A slider is a number field with a fixed range, drawn with a filled bar that shows where the value sits between the lowest and highest values. Drag anywhere in the box to move through the range. Crossing the whole range takes several widths of mouse travel, so you can set a value precisely, and Shift and Ctrl work as they do for other number fields. Neither dragging nor typing can take a slider outside its range.
Steppers¶
A stepper holds a whole number and has - and + buttons beside the box. Click a button
to step the value down or up, or hold it down to keep stepping. You can also click the box and
type a number or an expression. If a stepper can't work out what you typed, it uses the number
at the start of the text, if there is one: 5cm becomes 5.
Expressions¶
Every number field works out simple arithmetic. The expression is evaluated when you apply the value, so type the whole expression and then press Enter.
| Write | Meaning | Example | Result |
|---|---|---|---|
+ - |
Add, subtract | 2+3 |
5 |
* / |
Multiply, divide | 0.5*3 |
1.5 |
^ |
Power | 2^10 |
1024 |
( ) |
Group | (1+2)/4 |
0.75 |
- before a value |
Negate | -(2+3) |
-5 |
e after a number |
Scientific notation | 2.5e3 |
2500 |
Functions take one value in brackets:
| Function | What it returns | Notes |
|---|---|---|
sin(x), cos(x), tan(x) |
Sine, cosine, tangent | x is in radians. |
asin(x), acos(x) |
Arcsine, arccosine, in radians | x must be between -1 and 1. |
atan(x) |
Arctangent, in radians | |
sqrt(x) |
Square root | x can't be negative. |
floor(x), ceil(x), round(x) |
x rounded down, up, or to the nearest whole number |
|
exp(x) |
e raised to the power x |
|
log(x), log2(x), log10(x) |
Natural, base-2 and base-10 logarithm | x must be greater than 0. |
r2d(x) |
x converted from radians to degrees |
|
d2r(x) |
x converted from degrees to radians |
The constants pi and e are also available.
A few rules to keep in mind:
- Function and constant names are lowercase:
sqrt(2)works,Sqrt(2)doesn't. - Write multiplication out:
2*pi, not2pi. - Use a point as the decimal separator:
0.5, not0,5. Spaces are fine:0.5 * 3. ^is applied before a leading minus, so-2^2is-4. Write(-2)^2for4.- There is no
min,max,absorpow. Use^for powers.
In a number field, an expression is rejected, and the field keeps its old value, if it divides
by zero, takes the square root of a negative number or the logarithm of zero or less, passes
asin or acos a value outside -1 to 1, uses a name that isn't in the tables above, or gives a
result too large to store.
Degrees and radians
The Inspector shows rotations in degrees, while the trigonometric functions work in
radians. To enter an angle you know in radians, type r2d(1.2). To use a sine of an angle
in degrees, convert it first: sin(d2r(30)) gives 0.5. Units explains where
the editor uses degrees and where it uses radians.
Units¶
Inspector fields don't accept unit suffixes. In an Inspector number field, a value such as
5cm or 90deg is rejected and the field keeps its old value. Enter values in the units the
field uses,
which Units lists: metres for distances and degrees for rotations, for example.
Script fields that declare a unit show it in their label, such as Cooldown (s), but you
still type a plain number.
Three other places in the editor do read units:
- When you move a selection by typing a distance in the viewport, you can end the number
with a length unit:
mm,cm,m,km,inorft, as in25cm. See Viewport Navigation. - The popups of the Scene viewport's toolbar, such as Camera, show some values with a unit after the number. Those fields accept any unit of the same kind, as listed below. See The Viewport.
- The zoom box of the Image Viewer takes a percentage, and also accepts
%orx, so1.5xmeans 150%. See Viewing Files.
In the toolbar popups, a plain number is read in the unit the field shows, and a number with a
unit is converted: typing 25cm into a field shown in metres sets it to 0.25 metres.
In an expression, each number can have its own unit, as in 1m+20cm.
| Kind of value | Example fields | Shown in | Units you can type |
|---|---|---|---|
| Length | Near Clip, Far Clip, Focus Distance | metres | mm, cm, m, km, in, ft |
| Angle | Vertical FOV | degrees | deg or °, rad |
| Time | Shutter Speed, Brighten Time, Darken Time | seconds | ms, s, min, h |
| Percentage | The gizmo Size in the Overlay popup | percent | %, or x for a multiple: 1.5x is 150% |
Vector fields¶
A vector field shows one number field per component, each with a coloured badge on its left: red X, green Y and blue Z. Fields with four components show thin coloured bars instead of letters, with a light grey bar for W. Each component is an ordinary number field: drag it, type into it, or enter an expression.
Click a badge to reset that component. Its tooltip reads Reset. Most components reset to
0; the Transform's Scale resets to 1.
Colour fields¶
A colour field has a number field for each of the red, green and blue components, plus alpha for colours that have one, and a swatch showing the colour.
- Drag or type the components like any other number field. They run from 0 to 255 by default, and typed values are clamped to that range.
- Click the swatch to open a colour picker.
- Right-click the components or the swatch to choose how the colour is shown: RGB, HSV or Hex, with components from 0..255 or 0.00..1.00.
Reference fields¶
A reference field points to something else: an asset, such as a mesh or a material, an entity in the scene, or a C# script class. It shows the name of what it points to.
- Click the field to open a list of everything it can point to, sorted by name, with the current value highlighted. For assets, each row also shows the asset's type.
- The cursor starts in the search box, so you can type part of a name straight away to narrow the list. Click an entry, or move through the list with Up and Down and press Enter, to pick it.
- Clear, at the top of the list, empties the field. It is there when the field has a value and is allowed to be empty.
- Press Esc or click outside the list to close it without changing the field.
- Double-click an asset field to open the asset in its editor, if it has one, or a script field to open the script.
Add Component in the Inspector uses the same kind of list; see Adding components.
Editing several entities at once¶
With several entities selected in the Scene Hierarchy, the Inspector edits all of them together: most values you change are set on every selected entity.
In the Transform, components that differ between the selected entities show a dim MIXED instead of a number. Typing a value into one component sets that component on every entity and leaves their other components as they were, so you can, for example, line up several objects on one axis. Dragging a component instead moves, rotates or scales every selected entity by the same amount. Single number fields don't show MIXED; they show the value of one of the selected entities.
Where to go next¶
- Units lists the unit each kind of value uses.
- Editor Interface shows where the Inspector and the other panels are.
- Editor Attributes control how your own script fields appear in the Inspector, including ranges, sliders and unit labels.