Enums
Rally uses plain strings where some engines use enum objects:
import { Part, getChild, workspace } from '@rally/sdk';
const sign = getChild(workspace, 'Sign', Part);sign.material = 'neon';sign.shape = 'cylinder';Rally Studio’s script editor checks the strings as you type, and the engine checks them when you
assign: an unknown value throws a TypeError that lists the allowed ones. Where @rally/sdk
exports a type for a set, you can use it in your own code:
let mode: CameraType = 'follow'.
Material
Section titled “Material”How a part’s surface looks. It changes only the look: physics uses friction, density and
restitution. Patterned materials show the part’s image instead of their pattern when it has
one.
- Used by:
BasePart.material(default'plastic') - TypeScript type:
Material(import type { Material } from '@rally/sdk')
| Value | Description |
|---|---|
'plastic' |
The default: a matte surface. |
'smooth' |
A glossier surface than plastic. |
'neon' |
Glows in the part’s color. |
'metal' |
Metallic and reflective. |
'glass' |
Glossy and see-through: at most 40% opaque, whatever the part’s transparency. |
'wood' |
A light wood-grain pattern. |
'grass' |
A light grass pattern. |
'ice' |
Glossy and slightly see-through: at most 90% opaque. |
'sand' |
A fine sand pattern. |
'brick' |
A brick pattern. |
PartShape
Section titled “PartShape”The shape of a Part.
- Used by:
Part.shape(default'box') - TypeScript type:
PartShape(import type { PartShape } from '@rally/sdk')
| Value | Description |
|---|---|
'box' |
A box of the part’s size. |
'sphere' |
A ball with size.x as its diameter. |
'cylinder' |
An upright cylinder: size.y tall, as wide as the smaller of size.x and size.z. In 2D games it collides like a box. |
'capsule' |
An upright capsule (a cylinder with rounded ends): size.y tall, as wide as the smaller of size.x and size.z. |
TerrainMaterial
Section titled “TerrainMaterial”What terrain ground is made of. In Terrain.materials, each material
is stored as its index, given first below.
- Used by:
Terrain.material(default'grass'),Terrain.materials(as indexes),TerrainPaintStroke.material - TypeScript type:
TerrainMaterial(import type { TerrainMaterial } from '@rally/sdk')
| Value | Description |
|---|---|
'grass' |
0. Green grass, the default. |
'sand' |
1. Pale sand. |
'rock' |
2. Gray rock. |
'snow' |
3. White snow. |
'mud' |
4. Brown mud. |
'ice' |
5. Pale blue ice. |
SculptMode
Section titled “SculptMode”What a Terrain.sculpt brush does. Every mode fades out
toward the edge of the brush.
- Used by:
TerrainStroke.mode - TypeScript type:
SculptMode(import type { SculptMode } from '@rally/sdk')
| Value | Description |
|---|---|
'raise' |
Raises the ground by strength studs at the center of the brush. |
'lower' |
Lowers the ground by strength studs at the center of the brush. |
'smooth' |
Blends each height toward its neighbors’ average; strength (0 to 1) is how far. |
'flatten' |
Levels the ground toward target (a world height; by default the height at the brush center); strength (0 to 1) is how far. |
Easing
Section titled “Easing”The curve a tween or an animation follows from start (0) to end (1). “In” curves start slowly, “out” curves end slowly, and “in-out” curves do both.
- Used by:
Mover.easing(default'sineInOut'),TweenInfo.easing(default'quadInOut'),AnimationKey.easing(default'linear'),easings - TypeScript type:
Easing(import type { Easing } from '@rally/sdk')
| Value | Description |
|---|---|
'linear' |
Constant speed. |
'quadIn' |
Starts slowly and speeds up (quadratic). |
'quadOut' |
Starts fast and slows down (quadratic). |
'quadInOut' |
Slow at both ends (quadratic). The default for tweens. |
'cubicInOut' |
Slow at both ends, with a faster middle (cubic). |
'sineInOut' |
Slow at both ends, along a sine curve: good for back-and-forth motion. |
'backOut' |
Overshoots the end a little, then settles back. |
'bounceOut' |
Bounces at the end, like a dropped ball. |
'elasticOut' |
Overshoots and wobbles around the end before settling. |
CameraType
Section titled “CameraType”How a player’s Camera moves.
- Used by:
Camera.cameraType(default'follow') - TypeScript type:
CameraType(import type { CameraType } from '@rally/sdk')
| Value | Description |
|---|---|
'follow' |
The default. Follows subject (your character unless you set it): orbits it in 3D, tracks it from the side in 2D. |
'fixed' |
Stays at position, looking at lookAt. |
'scriptable' |
Stays at position, looking at lookAt, for scripts to move. Currently the same as fixed. |
CharacterState
Section titled “CharacterState”What a Character is doing, as its player’s device reports it.
- Used by:
Character.state(default'idle') - TypeScript type:
CharacterState(import type { CharacterState } from '@rally/sdk')
| Value | Description |
|---|---|
'idle' |
Standing still on the ground. |
'running' |
Moving on the ground. |
'jumping' |
In the air, going up. |
'falling' |
In the air, going down. |
'dead' |
Health reached 0. |
Dimension
Section titled “Dimension”Whether a game is 3D or 2D, set when the game is created.
- Used by:
Workspace.dimension(default'3d') - TypeScript type:
Dimension(import type { Dimension } from '@rally/sdk')
| Value | Description |
|---|---|
'3d' |
A 3D world. Physics and the camera use all three axes. |
'2d' |
A side-view world on the X/Y plane: position.z only decides what draws in front, physics ignores depth, and the camera looks at the plane from the side. |
Text alignment
Section titled “Text alignment”Horizontal alignment of a TextLabel’s text.
- Used by:
TextLabel.textAlign(default'center') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'left' |
Aligned to the left edge. |
'center' |
Centered. The default. |
'right' |
Aligned to the right edge. |
Font weight
Section titled “Font weight”How bold a TextLabel’s text is.
- Used by:
TextLabel.fontWeight(default'medium') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'normal' |
Regular weight. |
'medium' |
Slightly bolder. The default. |
'bold' |
Bold. |
Image scale type
Section titled “Image scale type”How an ImageLabel fits its image into its box.
- Used by:
ImageLabel.scaleType(default'fit') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'fit' |
The whole image fits inside the box, keeping its proportions. The default. |
'fill' |
The image covers the whole box, keeping its proportions; edges may be cut off. |
'stretch' |
The image is stretched to the box’s exact size. |
Input kind
Section titled “Input kind”What kind of input an InputObject is.
- Used by:
InputObject.kind - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'key' |
A keyboard key. |
'mouse' |
A mouse button. |
'touch' |
Reserved: players’ devices don’t report touches as input objects today. |
Door opens
Section titled “Door opens”What opens a Door, from Door.opens.
- Used by:
Door.opens(default'touch') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'touch' |
A character touches the door. |
'near' |
A character comes close to the door. |
'trigger' |
Something activates it: a Trigger, or a script calling activate(). |
Trigger action
Section titled “Trigger action”What a Trigger does to its target, from Trigger.action.
- Used by:
Trigger.action(default'activate') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'activate' |
Calls activate() on the target behavior, or on every behavior inside the target. |
'enable' |
Turns the target behavior (or every behavior inside it) on. |
'disable' |
Turns the target behavior (or every behavior inside it) off. |
'toggle' |
Turns each of those behaviors on if it’s off, and off if it’s on. |
Round end
Section titled “Round end”What a RoundTimer does at zero, from RoundTimer.onEnd.
- Used by:
RoundTimer.onEnd(default'restart') - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'restart' |
Shows the end message, respawns everyone and starts the next round. |
'stop' |
Shows the end message and stops counting. |
Game role
Section titled “Game role”Where code is running, from game.role.
- Used by:
game.role - TypeScript type: a union of the string values below
| Value | Description |
|---|---|
'server' |
On the game server. |
'client' |
On a player’s device. |
'standalone' |
In Rally Studio’s Play, which runs the server’s and the client’s scripts together in your browser. |
Game visibility
Section titled “Game visibility”Who can find and play a game: a setting on the game’s page, not something scripts read. New games start private. Everyone involved needs to be signed in to Rally.
| Value | Who can see and play the game |
|---|---|
private |
You and the game’s collaborators. The default. |
unlisted |
Anyone with the link. It isn’t listed in Games. |
public |
Everyone: it’s listed in Games once it has a published version. |