Reference
Components
Each component lists its type name, which is what
set_property(type, property, value) takes, and each property’s script
name, the second argument. Properties appear in the Inspector under the
label shown first; a property marked From scripts has no row in the
Inspector and is set by a script.
This page is generated from the engine itself, so its names, defaults and choices are always the engine’s.
The manual explains how they fit together: scenes and objects, meshes and materials, lighting, cameras, physics, particles, audio and game UI.
Transform
Where an object is, how it’s turned, and how big it is, relative to its parent. Every object has one.
| Property | Script name | Default | |
|---|---|---|---|
| Translation | translation |
0, 0, 0 | Position, in units. |
| Rotation | rotation |
0, 0, 0 | Degrees about x, y and z, applied Y first: Y is always the heading. |
| Scale | scale |
1, 1, 1 | Size as a multiple of natural size. |
Mesh Renderer
Draws a shape or a mesh with a material.
| Property | Script name | Default | |
|---|---|---|---|
| Shape | shape |
Cube | Which shape to draw. Custom draws the Mesh below. Cube, Sphere, Cylinder, Capsule, Cone, Plane, Custom |
| From scripts | size |
1, 1, 1 | A cube’s or plane’s size. The Inspector sizes shapes with the object’s Scale instead; scripts can set this. |
| From scripts | radius |
0.5 | A sphere’s, cylinder’s, capsule’s or cone’s radius. Set from scripts; the Inspector uses Scale. |
| From scripts | height |
2 | A cylinder’s, capsule’s or cone’s whole height. Set from scripts; the Inspector uses Scale. |
| Segments | segments |
32 | How smooth a round shape is, around. |
| Rings | rings |
16 | How smooth a sphere or capsule is, top to bottom. |
| Mesh | mesh |
none | With Custom, the mesh to draw. |
| Material | material_guid |
none | The surface. None is plain white. |
| Visible | visible |
on | Drawn at all. |
| Cast shadows | cast_shadows |
on | Throws a shadow. |
| Receive shadows | receive_shadows |
on | Shadows fall on it. |
Reflection Probe
Captures its surroundings for reflections inside a box.
| Property | Script name | Default | |
|---|---|---|---|
| Active | is_active |
on | Used at all. |
| Half extents | half_extents |
5, 5, 5 | Half the size of its box. |
| Box projection | box_projection |
on | Reflections line up with the box’s walls. On for rooms. |
| Blend distance | blend_distance |
0.25 | How far inside its walls it fades out, in meters. |
| Intensity | intensity |
1 | How bright its reflections are. |
Text
A line of text in the world.
| Property | Script name | Default | |
|---|---|---|---|
| Text | text |
empty | What to draw. A new line breaks the line. |
| Size | size |
0.25 | Height of a line, in world units. |
| Color | color |
#FFFFFF | Tint. Its alpha fades the whole label. |
| Align | align |
Center | Where the text sits against the object’s position. Left, Center, Right |
| Billboard | billboard |
off | Turns to face the camera, staying upright. |
| Visible | visible |
on | Drawn at all. |
World Environment
The sky, and the light that fills the scene from everywhere.
| Property | Script name | Default | |
|---|---|---|---|
| Active | is_active |
on | Used at all. |
| Global | is_global |
on | Covers the whole scene. (Environments covering only part of one aren’t supported yet; turned off, it’s ignored.) |
| Priority | priority |
0 | Where several apply, the highest wins. |
| Half extents | half_extents |
5, 5, 5 | For a non-global environment, half the size of its box. |
| Sky top color | sky_top_color |
#8898B1 | Straight up. |
| Sky horizon color | sky_horizon_color |
#D3D7E0 | At the horizon. |
| Sky bottom color | sky_bottom_color |
#93939C | Straight down. |
| Ambient source | ambient_source |
Sky | Where the fill light comes from: the sky’s colors, one flat color, or nowhere. Sky, Color, Disabled |
| Ambient color | ambient_color |
#AEAEB5 | The flat fill color. Its alpha is ignored. |
| Ambient sky contribution | ambient_sky_contribution |
1 | With Sky, 1 is all sky, 0 all Ambient color. |
| Ambient intensity | ambient_intensity |
1 | How bright the fill light is. |
| Ambient occlusion | ambient_occlusion |
on | Darkens corners and creases. |
| AO radius | ao_radius |
1 | How far, in units, a surface looks for what hems it in. |
| AO intensity | ao_intensity |
1 | How dark it gets. |
Directional Light
Light from one direction, everywhere: the sun. Always casts shadows.
| Property | Script name | Default | |
|---|---|---|---|
| Color | color |
#FFFEFA | The light’s color. |
| Intensity | intensity |
1 | Brightness. |
| Enabled | enabled |
on | Lights the scene at all. |
Point Light
Light in every direction from a point.
| Property | Script name | Default | |
|---|---|---|---|
| Color | color |
#FFFCF4 | The light’s color. |
| Intensity | intensity |
1 | Brightness. |
| Range | range |
10 | How far it reaches, in units. |
| Enabled | enabled |
on | Lights the scene at all. |
| Cast shadows | cast_shadows |
off | The two nearest the camera get shadows. |
Spot Light
A cone of light.
| Property | Script name | Default | |
|---|---|---|---|
| Color | color |
#FFFFFF | The light’s color. |
| Intensity | intensity |
1.5 | Brightness. |
| Range | range |
15 | How far it reaches. |
| Inner angle | inner_angle |
20 | Degrees from the center that are fully lit. |
| Outer angle | outer_angle |
35 | Degrees from the center where it fades to nothing. |
| Enabled | enabled |
on | Lights the scene at all. |
| Cast shadows | cast_shadows |
off | The four nearest the camera get shadows. |
Camera
What the game draws from.
| Property | Script name | Default | |
|---|---|---|---|
| Projection | projection_type |
Perspective | Perspective for a normal 3D view; Orthographic for a flat one where nothing shrinks with distance. Perspective, Orthographic |
| Field of view | fov |
60 | Degrees, top to bottom. |
| Size | ortho_size |
10 | Orthographic height, in units. |
| Near clip | near_clip |
0.1 | Closest it sees. |
| Far clip | far_clip |
1000 | Farthest it sees. |
| Active | is_active |
off | This is the camera the game draws from. |
| Tonemap | tonemap |
ACES | How a bright frame is fit onto the screen. ACES is filmic; Reinhard is gentler. ACES, Reinhard, None |
| Exposure | exposure |
1 | Brightness before tonemapping. |
| Bloom intensity | bloom_intensity |
0.15 | Glow around bright areas. 0 is off. |
| Bloom threshold | bloom_threshold |
1 | How bright something must be to glow. |
| Clear color | clear_color |
#9F9F9F | Background color. |
| Clear | clear_color_enabled |
on | Uses Clear color for the background. |
Character Controller
Walks, climbs steps and slides along walls, driven by velocity from a script.
| Property | Script name | Default | |
|---|---|---|---|
| Slope limit | slope_limit_degrees |
45 | Steepest floor it walks up, in degrees. |
| Step height | step_height |
0.3 | Tallest ledge it steps over. |
| Snap distance | snap_distance |
0.2 | How far below its feet it keeps hold of the floor, so walking downhill isn’t falling. |
| Skin width | skin_width |
0.02 | A small gap kept from everything else. |
| Gravity scale | gravity_scale |
1 | Gravity for this character. |
| Mass | mass |
80 | How hard it shoves dynamic bodies. 0 shoves nothing. |
Collider
The shape an object collides with.
| Property | Script name | Default | |
|---|---|---|---|
| Shape | shape |
Box | The shape it collides as. The two mesh shapes use Mesh. Box, Sphere, Capsule, Cylinder, ConvexMesh, TriangleMesh |
| Half extents | half_extents |
0.5, 0.5, 0.5 | Box: half its size. |
| Radius | radius |
0.5 | Sphere, capsule, cylinder. |
| Half height | half_height |
0.5 | Capsule, cylinder. |
| Mesh | mesh |
none | ConvexMesh and TriangleMesh. |
| Restitution | restitution |
0.3 | Bounciness. 0 is a dead stop. |
| Friction | friction |
0.5 | Grip. 0 is ice. |
| Friction combine | friction_combine |
Min | How this friction combines with the other collider’s when they touch. Average, Min, Multiply, Max |
| Restitution combine | restitution_combine |
Min | How this bounciness combines with the other collider’s. Average, Min, Multiply, Max |
| Density | density |
1000 | Mass per unit of volume. |
| Sensor | is_sensor |
off | Reports overlaps instead of blocking. |
| Collision groups | collision_groups |
4294967295 | The layers it’s in, as a mask. |
| Collision mask | collision_mask |
4294967295 | The layers it hits, as a mask. |
Fixed Joint
Glues two bodies together.
| Property | Script name | Default | |
|---|---|---|---|
| Connected body | connected_body |
none | The other body. |
| Anchor | anchor |
0, 0, 0 | Where it attaches on this body, in its own space. |
| Connected anchor | connected_anchor |
0, 0, 0 | Where it attaches on the other. |
Hinge Joint
Lets two bodies turn about one axis.
| Property | Script name | Default | |
|---|---|---|---|
| Connected body | connected_body |
none | The other body. |
| Anchor | anchor |
0, 0, 0 | Where it attaches on this body, in its own space. |
| Connected anchor | connected_anchor |
0, 0, 0 | Where it attaches on the other body. |
| Axis | axis |
0, 1, 0 | The axis to turn about, in this body’s space. |
| Limits | use_limits |
off | Stops between Min angle and Max angle. |
| Min angle | min_angle |
-90 | Degrees. |
| Max angle | max_angle |
90 | Degrees. |
| Motor | use_motor |
off | Drives itself. |
| Motor speed | motor_speed |
0 | Degrees per second. |
| Motor max force | motor_max_force |
100 | How hard it may push. |
Rigid Body
How an object moves under physics.
| Property | Script name | Default | |
|---|---|---|---|
| Body type | body_type |
Dynamic | Dynamic moves under physics, Static never moves, Kinematic moves only when a script moves it. Static, Dynamic, Kinematic |
| Mass | mass |
1 | Kilograms. |
| Linear damping | linear_damping |
0.1 | Slows movement over time. |
| Angular damping | angular_damping |
0.1 | Slows turning over time. |
| Gravity scale | gravity_scale |
1 | 0 floats. |
| Can sleep | can_sleep |
on | Rests until touched, costing nothing. |
| Can rotate | can_rotate |
on | Off keeps it upright. |
Spring Joint
Pulls two bodies toward a distance apart.
| Property | Script name | Default | |
|---|---|---|---|
| Connected body | connected_body |
none | The other body. |
| Anchor | anchor |
0, 0, 0 | Where it attaches on this body, in its own space. |
| Connected anchor | connected_anchor |
0, 0, 0 | Where it attaches on the other body. |
| Rest length | rest_length |
1 | The distance it settles at. |
| Stiffness | stiffness |
100 | How hard it pulls back. |
| Damping | damping |
5 | How quickly it stops bouncing. 0 bounces forever. |
Audio Listener
The ears. The first active one hears.
| Property | Script name | Default | |
|---|---|---|---|
| Active | is_active |
on | The first active listener in the scene is the one that hears. |
Audio Source
Plays a sound.
| Property | Script name | Default | |
|---|---|---|---|
| Clip | clip_guid |
none | The sound file. |
| Volume | volume |
1 | 1 is the clip’s own level. |
| Pitch | pitch |
1 | Speed and pitch together. |
| Looping | looping |
off | Starts again when it ends. |
| Play on awake | play_on_awake |
on | Starts when the game does. |
| Spatial | spatial |
on | Fades with distance and pans. |
| Streaming | streaming |
off | For long music and ambience. |
| From scripts | play_requested |
off |
Set true from a script to play once.
|
| From scripts | stop_requested |
off |
Set true from a script to stop.
|
Script
A Cog script. An object can have several. Your script components appear under their own names.
| Property | Script name | Default | |
|---|---|---|---|
| Script | script_guid |
none |
The .cog file.
|
Animator
Switches an object’s mesh or material between named states, from a script: get_component("Animator").play("hurt"). (Swapping, not skeletal animation.)
| Property | Script name | Default | |
|---|---|---|---|
| Current state | current_state |
empty | The state showing now. |
Particle Emitter
Throws out sprites: smoke, sparks, dust.
| Property | Script name | Default | |
|---|---|---|---|
| Playing | playing |
on | Emitting at all. |
| Rate | rate |
10 | Per second. |
| Burst | burst |
0 | At once, when it starts. |
| Looping | looping |
on | Forever, or for Duration. |
| Duration | duration |
5 | Seconds, when not looping. |
| Max particles | max_particles |
1000 | The most alive at once. |
| Shape | shape |
Cone | Where particles come from. Point, Sphere, Cone |
| Radius | radius |
0.5 | Sphere and cone. |
| Angle | angle |
25 | Cone spread, in degrees. |
| Space | space |
World | World leaves particles behind; Local carries them. World, Local |
| Lifetime | lifetime |
1, 2 | Seconds. |
| Speed | speed |
1, 2 | Units per second. |
| Size | size |
0.2, 0.4 | Units, at birth. |
| Size at death | size_end |
1 | Multiple of the birth size. |
| Color | color |
#FFFFFF | At birth. |
| Color at death | color_end |
#FFFFFF (clear) | At death. |
| Gravity | gravity |
0 | Multiple of gravity. Negative rises. |
| Drag | drag |
0 | Slowing down. |
| Texture | texture |
none | The sprite. None is a soft dot. |
| Blend | blend |
Alpha | Additive brightens what’s behind it: fire, sparks, magic. Alpha, Additive |
| Seed | seed |
0 | 0 is random each play. |
| From scripts | emit_requested |
0 |
Set by a script’s emit(count).
|
| From scripts | clear_requested |
off |
Set by a script’s clear().
|
| From scripts | restart_requested |
off |
Set by a script’s play() on an emitter that isn’t looping.
|
Canvas
Shows a UI document over the screen.
| Property | Script name | Default | |
|---|---|---|---|
| Document | document |
none |
The .ogui.
|
| Visible | visible |
on | Drawn at all. |
| Order | order |
0 | Higher draws on top. |
| Scaling | scaling |
ConstantPixels | ConstantPixels keeps every size in pixels; ScaleWithScreen scales the document as if the screen were Reference size. ConstantPixels, ScaleWithScreen |
| Reference size | reference_size |
1920, 1080 | The screen size it was made for. |
| Screen match | screen_match |
0.5 | 0 follows width, 1 height. |