Skip to main content

Components

Components hold an object's settings. Here is what each one does, and which settings often surprise people.

Components are named here as the inspector shows them. Where the engine's name differs, it is given in code.

For every field, its type and its default, see the component reference.

Transform​

Where an object is, how it is turned and how big it is.

  • Position is in metres.
  • Scale is a plain multiplier.
  • Rotation is in degrees everywhere you see it.
Scripts use radians for rotation

The inspector and patch ports show degrees and convert for you. Only in a script do you read and write rotation in radians. A right angle there is Math.PI / 2.

Look At​

Turns an object to face a point in the world, or a point at an offset from its own position. Use it for signs that face the visitor, or for lights that follow a target.

Look At controls rotation while it is on

Setting or animating rotation elsewhere will seem to do nothing. Remove Look At first.

3D Model​

The shape of an object (GeometryComponent). There are fifteen built-in shapes: box, sphere, cylinder, capsule, circle, cone, plane, triangle, ring, torus, three polyhedra, extrude and lathe. Geometry can also point to imported geometry.

Two shapes are especially useful:

  • Extrude gives depth to an outline you draw. Use it for logos, signs and cut-out shapes.
  • Lathe spins a profile around an axis. Use it for vases, bottles and columns.

To round the corners of a box, set its corner radius above zero.

Material​

How a surface looks. A material component holds a list of slots, so one object can have several materials. There are eight material types, and each type accepts its own set of texture maps.

→ Materials

Text​

Font size is in pixels. 1000 px is one metre in the world, so 72 px text is about 7 cm tall. That is fine on a table, but too small to see across a room.

Text appears a moment after the rest of the object. This is on purpose: it avoids showing one frame of text at the wrong size.

Video and audio​

Both play media files, but their defaults are different:

  • Video starts muted, and its sound is not positional. Browsers do not autoplay video with sound.
  • Audio starts unmuted and positional: it gets louder as the visitor comes closer.

Several objects can play the same file, each on its own. Two TVs can show one clip without getting in each other's way.

Do not use the audio component for sound effects

It plays one sound at a time, so playing it again cuts off the last one. Footsteps stutter, and several shots sound like one. Play effects from a script instead: each call starts its own sound. → ctx.audio

3D text​

3D text is separate from ordinary text. It is real geometry with depth, so it catches light, casts shadows and can use a material like any other object.

  • Use 3D text for signs and titles that sit in the world.
  • Use ordinary text for anything that must stay readable from far away.

Skeletons and bones​

An imported character comes with a skeleton and its bones. You rarely edit them directly. They let the model bend when its animation plays. You can also animate a single bone on the timeline.

Instancer and particles​

Two components for many copies of something:

  • Instancer repeats one object's geometry thousands of times and stays fast. Use it for grass, crowds and asteroid fields. → Prefabs
  • Particles (ParticleEmitterComponent) makes fire, smoke, sparks and rain, just as fast. → Particles

Path​

A curve drawn through points. It can become geometry, like a pipe, a rope or a road. It can also be a route for something to follow. → Paths

Camera and extra views​

A camera decides what your visitor sees. An Extra camera view draws a second picture from a camera, for a minimap or a security monitor. → Cameras

Shader graph​

A material you build from nodes, for looks the standard material types cannot make. You put it on an object through a material slot, like any saved material. The shader graph component (ShaderGraphComponent) holds a full-screen effect, and the inspector shows it as Post-processing. → Material graphs

Prefab​

Marks an object as a copy of a saved group of objects that you can reuse. → Prefabs

Shadows and morph targets​

Shadow sets whether an object casts and receives shadows. The setting also applies to everything inside the object.

Morph targets are the blend shapes that come with a model: facial expressions, a flag rolling up, a character shifting its weight. Each one is a weight from 0 to 1. You can animate all of them on the timeline.

Physics components​

Rigid Body sets how the engine moves an object:

  • Dynamic: falls, collides and can be pushed.
  • Static: never moves, but stops everything else.
  • Kinematic: moves only when you move it, and pushes other things aside as it goes.
  • None: no physics for this object or anything inside it, not even the solid shape it would get on its own.

It also has a multiplayer ownership setting:

  • shared: one object for the whole room. Everyone sees the crate in the same place.
  • local: each person simulates their own copy.

A player character must be local. If it is shared, every participant's avatar moves when one person walks.

Collider is the shape physics uses: box, sphere, cylinder, capsule, plane, or auto to work it out from the geometry.

Initial velocity is a push the object gets once, when it is created. It does not keep pushing.

Physics state is read-only. The engine writes how fast the object is moving and whether it has come to rest, so a script can read them.

→ Physics explains how these work together.

Tags​

Small labels that a plugin or a script puts on the objects it creates, so it can find them later. The editor does not show tags. If you generate scenes from code, use tags to mark the objects that belong to you.


Next: Materials — how surfaces look.