Live scene lenses

WebGPU v5: Live optics guide. Ray tracing against current mesh geometry through spherical glass.

setOpticalObjects

setOpticalObjects(names): Promise. Replace live optical selection with already-loaded named mesh roots. Up to32 roots,64 renderers,100000 triangles. Static meshes readable; skinned meshes supported with CPU bake/refit. GPU traces geometry, not a screenshot. Does not alter physics. Read LIVE_OPTICS.txt.

createOpticalLens

createOpticalLens(name,x,y,z,radius=1,index=1.5,samples=1): Promise. v5 live spherical lens in MainCamera. Register geometry first. Radius>0<=100,index1..3,samples1 or4 rays per pixel. Automatically updates each frame. Perspective camera outside sphere. Read LIVE_OPTICS.txt limits.

setOpticalLens

setOpticalLens(name,x,y,z,radius=1,index=1.5,samples=1): Promise. Move lens/change radius, refractive index or quality. Samples1 or4 per display pixel. A quality slider selects; Apply calls this. Existing object motion updates automatically.

removeOpticalLens

removeOpticalLens(name): Promise. Remove the live glass lens without deleting scene objects.

getLiveOpticsState

getLiveOpticsState(): Promise. Reports opticalObjects and opticalTriangles from the current live registry, version5. getGPUCapabilities reports liveSceneOptics=true. clearRun removes the registry/lenses.

Lenses, mirrors and ray tracing — WebGPU preview

Requires GPU capabilities version4. Full optics contract and examples.

viewOpticalImage

viewOpticalImage(name,surfaces,source,view,options={}): Promise. Observer image looking THROUGH analytic glass spheres/lenses/mirrors at flat source picture, NOT a live Unity model. source {url,center,width,height}; view {eye,center,width}, square XY display plane. options resolution=128,segments=8,distance=20,branch=transmit,background=[.025,.035,.055],extent=1000. Trace sphere entry and exit with Snell/Fresnel; no new camera. Re-call after changes. Read OPTICS.txt.

traceOpticalRay

traceOpticalRay(origin,direction,surfaces,options={}): synchronous CPU single-ray diagnosis. Shapes plane/sphere/lens, materials mirror/glass/absorber, centers/normals/radius, lens focalLength, glass nMinus/nPlus, sphere capCos. Exact Snell/Fresnel/TIR; ideal paraxial lens. options segments=8<=16,distance=20,branch=transmit/reflect. Returns segments and truncated. Read OPTICS.txt.

measureThinLens

measureThinLens(focalLength,objectDistance): synchronous paraxial 1/f=1/u+1/v, u>0. imageDistance, magnification=-v/u, real, atInfinity. At u=f returns null distances. Negative imageDistance is virtual and cannot project onto a screen.

drawOpticalRays

drawOpticalRays(name,rays,surfaces,options={}): Promise. GPU ray paths through <=32 plane/sphere/lens surfaces. rays 1..128 each {origin,direction,color}; options segments=8,distance=20,width=.01,branch=transmit,extent=1000. Creates/updates same-size line collection; removeGPUInstances before count change. Mathematical surfaces are not visible meshes or physics colliders. See OPTICS.txt.

renderOpticalImage

renderOpticalImage(name,surfaces,source,screen,options={}): Promise, v4. ONE ideal lens normal+/-Z; parallel XY flat source picture and square projection screen on opposite sides. source {url,center,width,height}, screen {center,width}. options resolution=128 (16..256),samples=16 (1..64),distance=20,extent=1000. Image <=4MiB,2048x2048 PNG/JPEG/WebP HTTPS/CORS or same-origin. GPU inversion/focus/defocus. Normalized brightness, no diffraction or arbitrary Unity-model ray tracing. Re-call after lens/screen moves; keep URL/setup in editor. Read OPTICS.txt before use.

createGPUImage

createGPUImage(name,width,height,options={}): v4 generic GPU RGBA grid on XY plane; options spacing=.01,origin first-cell center,extent=1000. colors from particles[i].color. Same 64-byte records and limits. Use renderOpticalImage for lens activities.

compileGPUTexture

compileGPUTexture(name,source,url): v4 runtime WGSL plus sourceImage:texture_2d<f32> binding2, read using textureLoad. <=4MiB file,<=2048x2048 PNG/JPEG/WebP. sRGB decoded to linear. Atomic replacement and per-collection URL caching; no snapshot bindings simultaneously. Texture memory included in compute budget. See OPTICS.txt.

var lens = {shape:"lens", center:[0,2,0], radius:0.3, focalLength:2};
var prediction = measureThinLens(2,6);
await drawOpticalRays("paths", [
    {origin:[0.2,2,-6], direction:[-0.2,0,6]},
    {origin:[0.2,2,-6], direction:[0,0,6]}
], [lens], {segments:3,distance:10});

Ideal thin lens: real image at distance3, inverted, half size. Glass interfaces use Snell and Fresnel equations. The projection tool uses a flat source picture, not arbitrary Unity scene geometry. Save settings and source URL in the activity for replay.

Scientific GPU fields and calculations — WebGPU preview

Requires getGPUCapabilities().version >= 3 and runtimeWGSL. These tools supply GPU data and visuals, not ready-made scientific solvers. Complete WGSL contract and examples.

createGPUField

Store four values per cell in a regular 2D or 3D grid. The origin is the center of the first cell; spacing is in world units. The display is one XY heatmap slice.

await createGPUField("temperature", 64, 64, 1, {
    spacing: 0.1, origin: {x: -3.15, y: 0.85, z: 0}
});

showGPUField

Select a scalar channel (0–3), display minimum/maximum, and Z slice without changing the calculation. Include a labeled color scale in the activity UI.

showGPUField("temperature", 0, 0, 100, 0);

compileGPUPasses

Run 1–8 WGSL stages in order. Each stage reads an immutable snapshot named previous and writes only its own particles[i]. The grid uniform supplies dimensions, origin and spacing. Time advances once per complete sequence. A rejected replacement keeps the old program.

await compileGPUPasses("temperature", [calculateDiffusion, calculateDiagnostics]);
runGPU("temperature", 0.001);

createGPULines

Draw GPU-controlled ray segments, paths or field diagrams. positionSize.xyz is the start, positionSize.w is full world-space width, velocityMass.xyz is the endpoint, and color is RGBA. This does not calculate ray intersections or retain automatic trail history.

await createGPULines("rays", 100, {size: 0.02});
await compileGPU("rays", rayCalculation);
runGPU("rays");

Use measureGPUInstance for selected measurements. Fields and lines share the existing count limits. Snapshot passes double record memory and share a 512 MiB compute-buffer budget. Full numerical assumptions and boundary conditions belong in the activity.

Browse CS functions by category

To Search this document use Command-F. Note: This is a dynamic document with notes of things that need to be changed or fixed. Check back often.

Basic Building

How do I use the Editor?
What kinds of objects can I load?
How do I position and rotate an object when it's loading?
How do I position, rotate and scale an object after it's loaded?
How do I get a camera to follow an object or two objects?
How do I change physics properties like friction,mass,velocity,angular velocity etc...
How do I change gravity?
How do I control the jeep and other special objects?
Can you teach me how to learn JavaScript?

Advanced Building

How do I position objects near other objects?
How do I build a tower of blocks using a for loop?
How do I check whether an object collided with another object?
How do I control the simulation speed?
How do I run my own function every second?
How do I make User Interfaces like buttons, sliders, and inputs?
How can I change the scenery and background?
What kinds of Visual Effects can I add
Do the characters have animations I can use?
Can I animate an object?

User Experience

Goals, Rewards, linking to Quizzes, Surveys
How do I set a goal that the user can reach and check that they reached it?
How do I show another webpage?
How do I reward a user?

Expert Building

How can I build my own machines?
IK Animation

Scientists

How can I Visualize Data
Can I change the shape of an object?
Global Variables
Rotations Eulers vs Quaternions
How do I make Meters, Points, and Graphs
Vector and Rotation Math
I want to use my own javascript library

Fun Features

Interactive Character Dialogue
Behaviors
I want to do some Interactive Fiction Programming

More Topics

To Search this document for other topics use Command-F

Editor Basics

Top Buttons

Run:Runs the code. Note this is somewhat buggy sometimes you have to hit it twice because the old code is not garbage collected. If it doesn't look right hit it again.
Run+: Adds code to the current scene
//: Comment or Uncomment
Binoculars: Find/Replace
Undo
Redo
Font-Size: Change the Font
Right Arrow: Go to Line

Bottom Buttons

Cmd: A command line interface for typing in single lines of code.
Run+:Runs the Code in the Command Line. Pressing Enter will also Run the code.
History:Shows a history of all commands used this session.

go to top




Browse all Editor Basics functions and related commands

Objects: Check back Weekly for new objects

Search Items


go to top


Browse all Objects: Check back Weekly for new objects functions and related commands

Loading and Positioning Objects

load(type,name,x,y,z,rx,ry,rz)

Loads an object with optional position and rotation

Parameters:

type:string a known object type like 'box'

name:string a name like 'box1',

x,y,z:num x,y,z of a vector

rx,ry,rz:num x,y,z of a rotation vector

Example:

load("box","box1");//without position or rotation
load('box','box2',0,10,0); //with positioning only
load('box','box2',0,10,0,0,90,0);//with 10 for y position and 90 for y rotation.
load('box','box2',0,0,0,0,90,0);//with 0,0,0 for position and 90 for y rotation
//build a tower using a for loop to load 10 boxes;
for(var i=0;i<10;i++){
  load('box','box'+i,0,1+i,0);//1 is added to the y position so the first box will not be in the ground
}

go to top


Browse all Loading and Positioning Objects functions and related commands

Setting Position, Rotation and Scale After Loading

Example:

load('box','box1');//Once and object is loaded you can refer to it by name
box1.setPosition(0,10,0);
box1.setRotation(0,45,0);
box1.setScale(2,2,2);
//you can also set them directly
box1.pos.x=5;
box1.rot.y=90;
box1.scale.x=2;
//or with vectors
box1.pos=vector(0,2,0);
box1.vel=vector(2,0,0);
box1.scale=vector(1,1,1);
//note do not scale the animals, they have joints and do not scale.

	

go to top


Browse all Setting Position, Rotation and Scale After Loading functions and related commands

Position by Reference

These commands allow you to position objects using a second object as a starting point.

//position an object based on another object 
//for the first object we use box1. For the second object we use box2
load('box','box1');
load('box','box2');

//put box1 ontop of box2 and other feats.
box1.ontop('box2');
box1.onbottom('box2');
box1.onleft('box2');
box1.onright('box2');
box1.infront('box2');
box1.inback('box2');
box1.ontop('box2',0,1,0);//an additional x,y,z can be added to adjust the position.
ontop("box1","box2",0,1,0);//another way to call ontop

go to top


Browse all Position by Reference functions and related commands

Cameras

setCamera(targetname, tracktype, startzoom, xoffset, yoffset, zoffset,endzoom,duration,stationary,type)

Sets the camera type

Parameters:

targetname:string like 'penguin' the name of whatever you want to track.

tracktype:string like 'track' or 'follow' track points the camera to the object, follow moves with the object

startzoom:number: Set the camera zoom lens for example 25 for a wide angle lens and 75 for zoom lens

xoffset,yoffset,zoffset:number how far you want the camera to offset from 0,0,0 like yoffset 15 which means the camera is 15 units up

Example:


setCamera("penguin","follow");
setCamera('penguin','follow',30,0,0,10);//follows with a wide angle lens of 30 and staying about 10 meters away from the Z direction.
setCamera("penguin","track");

go to top


Follow 2 objects at once

dynamicZoomOn(object1name, object2name)

Tries to Dynamically zoom in and out to keep both objects in the view.

Parameters:

object1name:string like 'penguin' the name of whatever you want to keep in view.

object2name:string like 'jeep' the name of whatever second object you want to keep in view

Example:

dynamicZoomOn('penguin','jeep')

go to top


controlCamera() or releaseCamera()

Allows you to control the camera with the mouse and keys. Hold shift and move the mouse to dolly the camera up or down, Hold option to pan left right up down

Example:


controlCamera();//allows you to control the camera with the mouse or arrow keys
releaseCamera();//you can no longer control the camera with the mouse or arrow keys

go to top


Browse all Cameras functions and related commands

Gravity

setGravity(g)

sets the gravity for every object in a scene

g:number or stringearth,moon,zerog, or a number like -9.81,0,-1 etc.

Example:


setGravity("moon");
setGravity("zerog");
setGravity("earth");
setGravity(-10);

go to top


Physics

Physics properties or functions you can use or set on all objects


//for these examples we use box1
load('box','box1'); 

//position
box1.pos=vector(0,0,0);
box1.pos=vector();
box1.pos.x=0;
box1.pos.y=0;
box1.pos.z=0;
box1.setPosition(0,0,0);


//rotation
box1.rot=vector(0,0,0);
box1.rot=vector();
box1.rot.x=0;
box1.rot.y=0;
box1.rot.z=0;
box1.setRotation(0,0,0);

//scale
box1.scale=vector(1,1,1);
box1.scale=vector();
box1.scale.x=1;
box1.scale.y=1;
box1.scale.z=1;
box1.setScale(1,1,1);//a scale of 0,0,0 means the object will disappear.

//velocity
box1.vel=vector(0,0,0);
box1.vel=vector();
box1.vel.x=0;
box1.vel.y=0;
box1.vel.z=0;
box1.setVelocity(0,0,0);

//angular velocity
box1.angvel=vector(0,0,0);
box1.angvel=vector();
box1.angvel.x=0;
box1.angvel.y=0;
box1.angvel.z=0;
box1.setAngularVelocity(0,0,0);

//acceleration 
//note this is added to the gravity force. Use gravityOff("box1") to remove gravity.
box1.acc=vector(0,0,0);
box1.acc=vector();
box1.acc.x=0;
box1.acc.y=0;
box1.acc.z=0;
box1.setAcceleration(0,0,0);

box1.zero();//this will reset the position, rotation, velocity, angular velocity and acceleration to vector(0,0,0).

//mass
box1.mass=10;

//friction and elasticity
box1.friction=1;//between 0 and 1. 0=no friction.
box1.setFriction(.5);
box1.setElasticity(0);//between 0 and 1. 1 is bouncy.

//positioning an object based on another object for the second object we use box2
load('box','box2');

//put box1 ontop of box2 and other feats.
box1.ontop('box2');
box1.onbottom('box2');
box1.onleft('box2');
box1.onright('box2');
box1.infront('box2');
box1.inback('box2');


//freeze an object so it won't move
box1.freeze();//box1 will no longer move with physics
box1.unfreeze();//box1 will move with physics
//prevent motion on z axis for 2D physics.
box1.setConstraints('z'); //object cannot move in z direction.
//note by default many objects like the penguin are already constrained in z
//to release them type in the following code
box1.setConstraints("none");//object can move in any direction.

go to top


Browse all Gravity functions and related commands

Browse all Physics functions and related commands

Objects with Special Functions

Jeep: setSteering,setSpeed,getSpeed

Wait for the stock Jeep to finish loading before using its methods. The older controls below remain available; custom game UI can call the same methods. See the reviewed wheel-drive contract and the callback limitations of getSpeed.

Example:

load('jeep','jeep');
jeep.setSteering(angle);//angle=a number;
jeep.setSpeed(amount);//amount=how fast the wheels turn
jeepspeed=jeep.getSpeed();//cached integer wheel command; may be undefined, not measured speed
//example user interface controls for the jeep
createSlider('jeepgas','speed',"jeep.setSpeed",-10,100,1,0,"true");
createSlider('jeepsteer','steer',"jeep.setSteering",-60,60,1,0,true);

go to top


Cannon: setAngle, setGunPowder, load, fire

Example:

load('cannon','cannon');
cannon.setAngle(30);//angle=a number;
cannon.setGunPowder(10);//amount=how much gunpowder does the cannon use to fire the cannonball.
cannon.loadObject(objectname);//you must set a loadObject before you can fire the cannon
cannon.fire();//fires the cannon
//example user interface controls for the cannon
createButton('cannonfire','fire','cannon.fire()');
createSlider("cannonangle","angle",'cannon.setAngle',0,130,1,0);
createHtmlButtonWithInput("cannonpowder","gunpowder",'cannon.setGunPowder',200);

go to top


Catapult: angle,tension,load,launch

Example:

load('catapult','catapult');
catapult.angle(30);//angle=a number;
catapult.tension(10);//amount=the strength of the spring that launches the catapult
catapult.load(name);//name of object you want to load into the catapult.
catapult.launch();//launches the catapult contents

go to top


Pendulum:

Example:

load('pendulum','pen');
pen.setAngle(90);
pen.setWeight(100);
pen.setLength(20);
pen.drop();
pen.setWeightObject('opencrate');//changes the object from a ball to whatever object you enter
pen.hidePendulumPost();
pen.showPendulumPost();
pen.pendulumPostCollide();
pen.pendulumPostDontCollide();
pen.breakJoint();
pen.remakeJoint();

go to top


communicationstower:

Example:

load('communicationstower','ct');
ct.setSpeed(10);//sets satellite speed

go to top


Spherebot: Your personal robot drone. You can control all physics except position

load('spherebot','sb');
sb.scale=vector(2,2,2);
sb.mass=10;
sb.velocity.y=10;
sb.moveTo(vector(0,0,0));//moves to the position given by a vector.
see the object physics section for more commands, but remember you cannot change spherebot's position.

go to top


Browse all Objects with Special Functions functions and related commands

Collisions

collisionWatch(object1name, object2name, enterfunc, exitfunc)

Checks for Collisions between object1 and object2 and runs functions when the objects enter or exit the collision

Parameters:

object1:object like box1 or penguin1

object2:object like box2 or penguin2

enterfunc: function name that is called when two objects enter a collision.

exitfunc: function name that is called when two objects exit a collision.

Example:


collisionWatch('penguin','box1','onEnter','onExit');

function onEnter(){
	log('enter');
	}
function onExit(){
	log('exit');
	}

go to top


Browse all Collisions functions and related commands

Joints

Joints are used to connect objects together. They initially start out like a steel rod, but you can change the joint properties to make a spring, a shock absorber, a swivel, a hinge, a motor etc. The joint code is based on the PHYSX D6 joint or the unity configurable joint. These joints are so confusing that most people avoid them. But you can create really cool stuff if you're patient. Before setting joints move them into the positions and rotations first and then freeze everything. Joints have to be created in a separate function call. If you try to create them when they are being loaded, positioned or frozen they will not work. After the joints are made unfreeze the parts.


createJoint(object1,object2)

Creates a locked Joint between two objects. Initially all the joint parameters will be locked. The joint will have no movement and the two objects will act like they are connected by a steel bar. The order matters too. Initially joints are connected at the center of mass of each object unless you change the anchor and axis settings below.

Parameters:

object1:object like box1

object2:object like box2

Example:

createJoint(box1,box2)

go to top


Working with joints

When a joint is created it is named after the two objects you connected. For example a joint connecting box1 and box2 will become box1box2. Joints have many properties and you can make all sorts of machines out of joints.

Examples:


//create a joint
createJoint(box1,box2);//creates a locked joint between box1 and box2 called box1box2.

//remove a joint
removeJoint(box1box2);

axis and anchors

//axis and secondaryaxis
/*In general you do not need to set this unless your joints are going to be at angles.  
If you don't set this then (xyz)LinearMotion and (xyz)AngularMotion of the joint will correspond to the same world x,y,z directions. If you do set this then X is no longer the world X, it's now the axis you set, and (xyz) LinearMotion and (xyz) AngularMotion of the joint will now no longer correspond to world xyz. In fact whatever axis you set will become the new X axis.  Confused? You can think of the X,Y,Z axis as placeholders like 1,2,3 where 1 is the axis you set, 2 is the secondary axis you set, and 3 is the axis that's perpendicular two 1, and 2.  If you set the axis as 0,1,0 which is world Y. The X axis in xLinearMotion and xAngularMotion will now correspond to Y.  After axis is set the secondaryaxis you set will correspond to yLinearMotion and yAngularMotion. zLinearMotion and zAngularMotion will default to the axis perpendicular to the first two you set.  So it will make it really confusing because X is no longer X world space. If you don't set axis it defaults to XYZ worldspace if you set them x,y,z will now map to axis, secondaryaxis, and axis perpendicular to the first two. Yes it's very confusing but that's the way PhysX and Unity set it up. This is one reason why very few people use it. 

box1box2.axis=vector(1,1,0);
box1box2.secondaryaxis=? find a perpendicular to your first axis.
//Remember once these are set it xLinearMotion and xAngularMotion and y and z no longer correspond to the world x,y,z.
//Developers Note: I might Change these to firstAxis, secondAxis, and thirdAxis on another build.

//anchor
//where the joint starts
//automatically set as the midpoint between the two objects but you can set it manually
//if you want to have the joint rotate around the first object as the center make the anchor=vector(0,0,0);
//if you want the joint to rotate around the second object make the anchor the position from the first object to the second
//for example if the first object is at 0,0,0 and the second is 5,0,0
//make the anchor be vector(5,0,0);
box1box2.anchor=vector(5,0,0);
box1box3.anchor=vector(5,5,0);


Motion along the axis of the joint
//xLinearMotion, yLinearMotion, zLinearMotion choices are free,limited,fixed
//this is the motion allowed on the different axis
box1box2.xLinearMotion='free';
//the boxes will move freely on the axis between them.
box1box2.xLinearMotion='limited';
//the boxes will move in a limited way on the axis between them after you set the limits.
box1box2.xLinearMotion='fixed';
//the boxes will not move relative to each other on the axis between them.

Rotation around the axis of the joint
//xAngularMotion, yAngularMotion, zAngularMotion choices are free,limited,fixed
//this is the rotational motion allowed on the different axis
box1box2.xAngularMotion='free';
//the boxes will rotate freely on the axis between them.
box1box2.xAngularMotion='limited';
//the boxes will rotate in a limited way on the axis between them after you set the limits.
box1box2.xAngularMotion='fixed';
//the boxes will not rotate relative to each other on the axis between them.

Motion limits
//xLinearLimit,yLinearLimit,zLinearLimit
//Limits how far along the axis a connected object will move.
//each limit has other properties such as bounce, spring, damper that change
//what happens when the object reaches the limit.
box1box2.xLinearLimit=5;//box2 will only move 5 units away from box1 before it hits a limit
box1box2.xLinearLimitBounce=0;//how bouncy the limit is
box1box2.xLinearLimitSpring=500;//how springy the limit is
box1box2.xLinearLimitDamper=500;//how much shock absorption the limit has

Rotation limits
//xAngularLimit,yzAngularLimit
//Limits how much of an angle the joint will rotate
//each angular limit has a high and low value and bounce, spring, and damper settings
box1box2.xAngularLimitLow=-45;
box1box2.xAngularLimitHigh=45;
box1box2.xAngularLimitLowBounce=0;
box1box2.xAngularLimitHighBounce=0;
box1box2.xAngularLimitLowSpring=500;
box1box2.xAngularLimitLowDamper=500;
box1box2.xAngularLimitHighSpring=500;
box1box2.xAngularLimitHighDamper=500;

//Note: Y and Z rotations have only 1 limit, not low and high. It is usually set
//around 0. So 90 would be -45 to 45. If you want to have a low and high setting
//you'll need to explore the axis and secondaryaxis settings because only X has a low and high setting choice.
box1box2.yAngularLimit=45;
box1box2.zAngularLimit=45;
box1box2.yAngularLimitBounce=0;
box1box2.zAngularLimitBounce=0;

//The spring and damper settings for Y and Z are lumped together as yz this is confusing and if you put in
//yAngularLimitSpring and zAngularLimitSpring it will not function correctly you have to use the weird yz.
//this is another reason no one wants to use these joints but it's part of the PHYSX physics engine.
box1box2.yzAngularLimitSpring=500;
box1box2.yzAngularLimitDamper=500;
//Developers Note: I may separate them for the user but then combine them in the underlying code to get rid of this confusion in another build.


Linear Drives Springs and Motors
//you can drive motion on the linear axis using a spring or motor or combo of both.
//linear spring drives drive toward a targetPosition on the axis
//linear motor drives drive towards a targetVelocity
//a spring is initially set to wherever the joint is made, that's it's resting state.
//if you try to move it from the resting state it will spring back. You can reset
//the resting state by using the targetPosition.

//a motor that moves on the main axis at a velocity of 5 m/s
box1box2.xLinearDriveMotor=500;
box1box2.xLinearDriveSpring=0;
box1box2.xLinearDriveForce=5000;//max force to use
box1box2.targetVelocity=vector(5,0,0);//sets the motor to move at a speed of 5 on the main axis

//a spring that moves on the main axis and doesn't want to move away from 5 on the main axis
box1box2.xLinearDriveMotor=0;
box1box2.xLinearDriveSpring=500;
box1box2.xLinearDriveForce=500;//max force to use
box1box2.targetPosition=vector(5,0,0);//tries to set the new resting state at 5,0,0 on the X axis. 
//make sure you set the resting state vector along the correct axis.

Angular Drives, Motors and Springs
//xAngularDrive,yzAngularDrive
//you can drive rotation around on the x axis using a spring or motor or combo of both.
//angular drive spring drives toward a targetRotationXYZ
//angular drive motor drives towards a targetAngularVelocity

//example motor that spins at 10 m/s around the main axis
box1box2.xAngularDriveMotor=500;
box1box2.xAngularDriveSpring=0;
box1box2.xAngularDriveForce=5000;//max force to use
box1box2.targetAngularVelocity=vector(10,0,0);//motor tries to spin at 10m/s

//a spring around main axis that doesn't like to be moved from it's target rotation
box1box2.xAngularDriveMotor=0;
box1box2.xAngularDriveSpring=500;
box1box2.xAngularDriveForce=5000;//max force to use
box1box2.targetRotationXYZ=vector(45,0,0);//spring is set at 45 degrees

//Y and Z axis are lumped together in yzdrive
box1box2.yzAngularDriveMotor=500;
box1box2.yzAngularDriveSpring=0;
box1box2.yzAngularDriveForce=5000;//max force to use
//Developers Note: I May separate these for the user and then combine in code.

//there is also a slerpDriveMotor,Spring, and Force you can use to move
//you'll have to look up slerp on google to find out what it is and I'm not
//sure if I included the target. 
//Developers Note: Check to see how slerp target rotation works.
box1box2.slerpDriveMotor=500;
box1box2.slerpDriveSpring=0;
box1box2.slerpDriveForce=5000;//max force to use

Breaking Joints
//breaking joints
//these are the forces and torques which will break the joints
box1box2.breakForce=1000;
box1box2.breakTorque=1000;
//If you want more info about these joints you can look up the Unity configurable joint
//and/or Physx or Unreal D6 joint, the names will be slightly different but you can the basic ideas from reading
//tutorials that use this same joint system which originally came from the PHYSX physics engine.

go to top


Browse all Joints functions and related commands

Simulation Controls

pause()

Pauses the simulation

none:none

Example:


pause();

go to top


unpause()

un-Pauses the simulation

none:none

Example:


unpause();

go to top


simSpeed(speed,time)

Changes the simulation speed. Normal speed is 1. Try .25 and 2

amount:number

time:numberoptional how long you want the speed to change in seconds, after which it will go back to normal at 1.

Example:


simSpeed(.25,3);//a slowmotion effect at 1/4 speed for 3 seconds.
simSpeed(2,1);//a fast motion effect at 2x speed for 1 second.
simSpeed(1); //change the speed to 1 with no time limit.

go to top


holdAll()

Changes every object to fixed so it won't move

Parameters:

Example:


holdAll();

go to top


releaseAll()

Releases every object from fixed so they will move again

Parameters:

Example:


releaseAll();

go to top


runInBackground(bool)

Allows the program to run in the background when the browser is hidden.

bool:true/false true or false

Example:


runInBackground(true);

go to top


Browse all Simulation Controls functions and related commands

Scene

setSky(name)

Changes the sky to a different type

Parameters:

name:string Type of sky. Examples:'bluesky','Galaxy3'

Example:

setSky('bluesky');

go to top


showAxes()

Shows the XYZ axis

Example:

showAxes();

go to top


hideAxes()

Hides the XYZ axis

Example:

hideAxes();

go to top


showStage()

The stage is the ground plane you can show or hide it

Example:

showStage();

go to top


hideStage()

Hides the ground plane

Example:

hideStage()

go to top


grid()

Shows a grid. Not implemented yet.

Parameters:

type:string Type of grid. Examples:english,metric

multiplier:number Multiplier of grid. Examples:10,100,.1,.01

Example:

grid('english',100);

go to top


Browse all Scene functions and related commands

Visual Effects

addVfx(who,what)

Attaches a visual effect to an object

Parameters:

who:string which object you want to apply the visual effect to. Examples: 'world','penguin1','box1'

what:string the name of the visual effect you want to add examples include 'smoke','fire','snow'

Example:

addVfx('box1','smoke');

go to top


removeVfx(who,what)

Removes the visual effect

Parameters:

who:string which object you want to remove the visual effect from

what:string the name of the visual effect you want to remove

Example:

removeVfx('box1','smoke');

go to top


addCameraFx(what)

Shows a camera visual effect

Parameters:

what:string the name of the visual effect you want to add examples include 'bloom','sepia','motionblur'

Example:

addCameraFx('bloom');

go to top


removeCameraFx(what)

Removes the camera visual effect

Parameters:

what:string the name of the visual effect you want to remove

Example:

removeCameraFx('bloom');

go to top


explode(force,x,y,z,radius,yadjust)

Causes an explosion at x,y,z with radius r

force:number strength of the force

x,y,z:x,y,z position of the center of the explosion.

radius:number radius of the explosion. The explosion will only affect things within this radius.

yadjust:number optional y axis adjustment to the explosion center. yadjust of -5 moves the explosion down by 5 so it throws objects higher.
yadjust of 0 will explode objects outward from the source but not upward. You can also make the adjustment in the x,y,z yourself and leave out the yadjust parameter

Example:


box1.pos=vector(0,0,0);//box1 position
explode(50,0,0,0,10,-5);//an explosion with force 50 centered at position vector(0,0,0) with a radius of 10 and y down -5;

go to top


Browse all Visual Effects functions and related commands

Character Animations

//the penguin and seagull do not have predefined animations.
The cow (coming soon mooooo!) will have animations like run, walk, idle, etc. 
//the structure to play an animation will be
  playCharacterAnimation(charactername,whichanimation,speed);
  //examples
  playCharacterAnimation("cow","walk",1);
  stopCharacterAnimation("cow");

go to top


Browse all Character Animations functions and related commands

Animating Objects

object.animateJoint(what, x, y, z, t, func,param)

If an object is a character you can animate the character's joints

what:string what joint you want to animate

x,y,z:numbers for x,y,z axis joint rotations

t:number how long you want the animation to take in seconds,

func:string name of a function you want to run after the animation is over,

param:any a parameter you can send with the function

Example:


load('penguin','penguin1');
penguin1.animateJoint('lHand',0,90,0,5)
penguin1.animateJoint('lHand',0,90,0,5,'done',5);
function done(x){
	alert(x)
}
//will animate the lHand changing the rotation 
//of the y angle 90 degrees in 5 seconds. 
//Then it will call the function 'done' and will 
//send 5 to the function.
//the result will be the lHand will move then when it's done 
//it will alert 5

go to top


object.animateMove(x,y,z,t,func,param)

Animates a position change. Please note to set the object's acceleration in the y direction to 0 before using object.animateMove
otherwise the acceleration physics will fight the movement animation.
While an object is moving with animationMove it will not experience regular physics
and may give unexpected results. If you want realistic physics please move objects by changing their velocity or acceleration.

x,y,z:numbers for x,y,z positions

t:number how long you want the animation to take in seconds,

func:string name of a function you want to run after the animation is over,

param:any a parameter you can send with the function

Example:


load('box','box1');
box1.acc.y=0;
box1.animateMove(0,2,0,5);
//will animate the movement of the box1 2 units in the y direction 
box1.animateMove(0,2,0,5,done,5);
//will do the same, but will also call the function 'done' 
//with parameter 5 after the animation is over.

go to top


object.animateRotate(x,y,z,t,func,param)

Animate a rotation change. While an object is moving with animateRotate it will not experience regular physics and may give unexpected results. If you want realistic physics please rotate objects by changing their angular velocity.

x,y,z:number for x,y,z rotations

t:number how long you want the animation to take in seconds,

func:string name of a function you want to run after the animation is over,

param:any a parameter you can send with the function

Example:


load('box','box1');
box1.acc.y=0;
box1.animateRotate(0,45,0,5);
//will rotate box1 45 degrees in the y direction in 5 seconds. 
box1.animateRotate(0,45,0,5,done,5);
//will do the same, but will also call the function 'done' 
//with parameter 5 after the animation is over.

go to top


object.animateScale(x,y,z,t,func,param)

Animates a scale change. While an object is moving with animateScale it will not experience regular physics and may give unexpected results. Note: normal scaling for x,y,z is 1,1,1 not 0,0,0. A scale of 0 in any direction will cause the object to have a thickness of 0 in that direction.

x,y,z:number for x,y,z scale default is 1,1,1 not 0,0,0

t:number how long you want the animation to take in seconds,

func:string name of a function you want to run after the animation is over,

param:any a parameter you can send with the function

Example:


load('box','box1');
box1.acc.y=0;
box1.animateScale(0,2,0,5);
//will animate the scaling of box1 in the y direction 
box1.animateScale(0,45,0,5,done,5);
//will do the same, but will also call the function 'done' 
//with parameter 5 after the animation is over.
 

go to top


Browse all Animating Objects functions and related commands

IK Animation

startIK(name,jointname)

Start inverse kinematics animation. You specify a joint to be controlled and it is controlled with a goal1 object which is loaded with the animal objects. So for a penguin named 'penguin' the goal1 object would be 'penguingoal1'. For a horse named 'seabiscuit' the goal object would be 'seabiscuitgoal1'. You can move the goal1 object with regular physics or the object.animate command.

Parameters:

name:string the name of the object you want to move

jointname:string the name of the joint you want to control

Example:

//joint names to choose from include: lHand,rHand,lFoot,rFoot,head
startIK('penguin','lHand');
penguingoal1.pos.x=5;//moves the goal1 to 5
//The hand should follow the goal.
penguingoal1.animateMove('vel',5,0,0,10);

go to top


endIK(name)

Turn off IK

Parameters:

name:string End inverse kinematics animation for this object.

Example:

endIK('penguin1');

go to top


Browse all IK Animation functions and related commands

Timed Events

createInterval(func,time,param)

provide a function name, and the time between tests in milliseconds. The function must exist before check is called

Parameters:

func:string,function you want to call in quotes like 'moo'

time:number milliseconds 1000 for 1 second or 5000 for 5 seconds

param:any optional parameter you want to send with the function could be a string or number or object or array

Example:

function moo(){
	if(cow.vel.y>10){
	alert('mooooo');
	}
}
createInterval('moo',1000) 

go to top


deleteInterval(func)

Deletes an interval by the function name provided when you created the interval.

Parameters:

func:string

Example:

deleteInterval('moo') 

go to top


deleteAllIntervals()

Deletes all intervals

Parameters:

none

Example:

deleteAllIntervals() 

go to top


createCountdownTimer(func,time)

Creates a countdown timer. You provide the function name that you want to call at the end of the countdown, and the time to countdown in milliseconds

Parameters:

func:string

time:number in milliseconds

Example:

createCountdownTimer('moo',5000)

go to top


deleteCountdownTimer(name)

Deletes a countdown timer with the name you gave when you created it

Parameters:

name:string

Example:

deleteCountdownTimer('moo') 

go to top


startTimer(name)

Creates a timer with the name you provide

Parameters:

name:string

Example:

startTimer('mytimer')

go to top


stopTimer(name)

stops a timer with the name you provided in startTimer

Parameters:

name:string

Return: time:number in milliseconds that has passed between calling startTimer and stopTimer. Return

Parameters:

Example:

timesofar=stopTimer('mytimer');
alert(timesofar);

go to top


Behaviors

createBehavior(id, condition, change, limit, waitforfalse)

Creates a behavior. A behavior checks to see if a condition is true. If the condition is true it runs whatever is in the variable called change. Behaviors have two other parameters called limit and waitforfalse. Limit tells how many times you want the behavior to run before it quits. A limit of 1 will run the behavior 1 frame then turn off. A limit of 0 will run the behavior every frame. Set waitforfalse = 1 if you want to only run the change the first time the condition is true. It will not run the change again until the condition is false, then it will turn it back on.

id:number

condition:code in quotes that you would normally put inside an if statement to see if something is true or not,

change:code in quotes that you want to run when the condition is true.

limit:number how many times you want the behavior to run before it turns off. 1 will run just one time. 0 will run every time.

waitforfalse:1 or 0 1 will turn it on. 0 will turn it off.

Example:


createBehavior(1,'cow.pos.y>10','cow.animation='walk'',0,true);
/*will play the walk animation if cow's height is > 10.
waitforfalse is 1 so once the cow.pos.y>10 it will no longer 
change the animation to walk until the cow position is not > 10.
Then it will turn it on again.
*/

go to top


deleteBehavior(id)

Deletes a behavior by id number.

id:number

Example:


deleteBehavior(1);

go to top


Browse all Behaviors functions and related commands

Chat

penguin.chat(to,message);

A method for sending a chat to a character and getting back a response.

Parameters:

to:string the name of the object you want to send the message to. For example 'penguin'.

message:string A text message

Example:


//first load two characters
load('penguin','joe');
load('penguin','moe');

//here is the start of the chat
joe.chat('moe','how is your meowser?');

//Before this will do anything, we have to make responses for the characters.
joe.chat.responses['how/cat']='My cat is a jerk'
joe.chat.responses['good']='Awesome!'

moe.chat.responses['how/cat']='My cat is cool!'
moe.chat.responses['good']='Oh that's fine'

//and add any synonyms to be replaced during the chat processing. Synonyms replace slang words with a common word before the response is analyzed for keywords
chatSynonyms['good']='swell/cool';//replaces swell or cool with good
chatSynonyms['cat']='feline/kitty cat/meowser';//replaces meowser or kitty cat with cat

//now we can have a chat...
joe.chat('moe','how is your meowser?');
//will trigger the following conversation...
//moe: My cat is cool!
//joe: Awesome!

//Here's how it works
//first synonyms are replaced. Meowser is replaced with cat and 'how is your cat' is sent to moe.
//Then the chat system looks through all of moe's responses for keyword matches.
//In moe's first response the keywords 'how' and 'cat' match the 'how' and 'cat' in the message so we send the response: 'My cat is cool.' back to joe.
//Now the receiver is joe. and the message is 'My cat is cool';
//the synonym 'cool' is replaced with 'good'.
//Joe's responses contain a keyword match for 'good' and that is 'Awesome';
//This is then sent back to moe
//Since there are no keyword matches for Awesome in any of moe's chat responses, the conversation ends.

go to top


Browse all Chat functions and related commands

Visualizing Data

vectorViewer(name, type, showx, showy, showz, showr, k)

Attaches vectors to an object that scale with the magnitude of the type

Parameters:

name:string like 'box1','penguin1','joe'

type:stringtype of vector viewer includes 'position','velocity','pkenergy','acceleration'

showx,showy,showz,showr:number 1 for true, 0 for false like 1,0,0,0 for x axis only

k:number like .5 or .01. Use this constant to adjust the vectors if they are too big or too small.

Example:


setupvectorViewer('box1','velocity',1,1,1,0,.5);
//will show velocity vectors for the object multiplied by .5
setupvectorViewer('box1','pkenergy',1,1,0,0,.5);
//will show potential vs kinetic energy. 
//Potential energy on the y axis and kinetic energy on the x axis.

go to top


hidevectorViewer()

Turns off the vector viewer

Example:


hidevectorViewer();

go to top


createField(type, objectname, xstart, ystart, zstart, xstep, ystep, zstep, xtotal, ytotal, ztotal, xscale, yscale, zscale){

Creates a grid of vectors that can change their position,scale,rotation,and color

Parameters:

name:string type of object used at each field coordinate: 'vx' or 'gpuparticle' are current choices.

objectname:string world if you want space filling field in x,y,z or use an on object name like 'box1' if you want the field to be drawn on the outer mesh of the object.

xstart, ystart, zstart:number start in each coordinate

xstep, ystep, zstep:number step in each coordinate

xtotal, ytotal, ztotal:number total for each coordinate

xscale, yscale, zscale:number scale in each coordinate

Example:


createField('gpuparticle','world', 0, 0, 0, 1, 1, 1, 10, 10, 10, 1, 1, 1);
createField('gpuparticle','box1',0,0,0,1,1,1,10,10,10,1,1,1);

go to top


updateFieldPositions(array)

You provide an array and it will update the field positions. The array size is xtotal*ytotal*ztotal that you used for createField

Parameters:

array:array array of position vectors

Example:


updateFieldPositions(positionarray);

go to top


updateFieldRotations(array)

You provide an array and it will update the field rotations. The array size is xtotal*ytotal*ztotal that you used for createField

Parameters:

array:array array of rotation vectors

Example:


updateFieldRotations(rotationarray);

go to top


updateFieldScales(array)

You provide an array and it will update the field scales. The array size is xtotal*ytotal*ztotal that you used for createField

Parameters:

array:array array of scale vectors

Example:


updateFieldScales(scalearray);

go to top


updateFieldColors(array)

You provide an array and it will update the field colors. The array size is xtotal*ytotal*ztotal that you used for createField

Parameters:

array:array array of color vectors. Note color vectors have 4 parts (r,g,b,a) representing red,blue,green,alpha from 0-255

Example:


updateFieldColors(colorarray);

go to top


removeField()

Removes the field

Parameters:

Example:


removeField();

go to top


drawPath(name)

Draws points so you can visualize the path of an object. As if the object is dropping pixels as it moves.

Parameters:

name:string name of the object you want to have a path

Example:


drawPath('box1');

go to top


resetPath(name)

Resets the path.

Parameters:

name:string name of the object you want to reset the path

Example:


resetPath('box1');

go to top


removePath(name)

Removes the path tracking ability from the object.

Parameters:

name:string name of the object you want to remove a path

Example:


removePath('box1');

go to top


createLinePoints(name)

Creates a line that looks like individual points. You must add points to the line before it will be visible.

Parameters:

name:string name of the line you want to work with to like 'myline'

Example:

createLinePoints('myline')

go to top


createLineContinuous(name)

Creates a continuous line from the points. You must add points to the line before it will be visible.

Parameters:

name:string name of the line you want to work with to like 'myline'

Example:

createLineContinuous('myline')

go to top


createLineDiscrete(name)

Creates a line that looks like line segments between every two consecutive points. You must add points to the line before it will be visible.

Parameters:

name:string name of the line you want to work with to like 'myline'

Example:

createLineDiscrete('myline')

go to top


addPointToLine(name,x,y,z)

Adds a point to a line

Parameters:

name:string name of the line you want to add the point to like 'myline'

x,y,z:number like 0,2,0 where the next point should be.

Example:

addPointToLine('myline',0,2,0)

go to top


removeLine(name)

Test

Parameters:

name:string name of the line you want to work with like 'myline'

Example:

createLines('myline')

go to top


Browse all Visualizing Data functions and related commands

Experimental

colorMesh(objectname)

A proof of concept demo which changes the colors of each triangle in the list of triangles gradually changing from red to blue as it goes through the triangles

objectname:string name of the object whose mesh you want to change colors

Example:


colorMesh('box1');

go to top


Color(r,g,b,a)

Represents a color with red, green, blue, and alpha values from 0-255

Parameters:

r:number red

g:number green

b:number blue

a:number alpha

Example:


c=Color(0,0,255,255);

go to top


Working with Meshes

buildMesh(objectname)

Changes the mesh of the object. To change a mesh simply change the values of SharedVertices and SharedTriangles and then call buildMesh(). Every consecutive 3 SharedVertices is automatically turned into an x,y,z vector point with an index. For example vertices 0,1,2 below are turned into vector(0,0,0) with index 0. Each consecutive 3 SharedTriangle indexes are drawn as a triangle.

objectname:string name of the object whose mesh you want to build from triangles and vertices

Example:


//each 3 vertices will be automatically be turned into vertice vectors with an index. 

	SharedVertices[0] = 0;
	SharedVertices[1] = 0;
	SharedVertices[2] = 0;
	//the first 3 are turned into the 0 index vertice vector(0,0,0);

	SharedVertices[3] = 0;
	SharedVertices[4] = 1;
	SharedVertices[5] = 0;
	//the second 3 are turned into the 1 index vertice vector(0,1,0);


	SharedVertices[6] = 1;
	SharedVertices[7] = 1;
	SharedVertices[8] = 0;
	//the third 3 are turned into the 2 index vertice vector(1,1,0);


//this will use the 3 vertice vectors we created by index 0,1,2 to draw a triangle
	SharedTriangles[0] = 0;
	SharedTriangles[1] = 1;
	SharedTriangles[2] = 2;
	
	//replaces the box1 mesh with the SharedTriangles defined by the SharedVertices
	buildMesh('box1');
	

go to top


Browse all Working with Meshes functions and related commands

Text

showText(text,time)

Shows 3D text on the screen

Parameters:

text:string The text you want to show. Has some RTF features. Use \n for line break.

time:string how long in seconds you want the text to stay on the screen.

Example:

showText('You Win!','title',5);

go to top


hideText()

Shows 3D text and a visual display. Used when a goal is reached.

Parameters:

Example:

hideText();

go to top


Browse all Text functions and related commands

User Interface Elements

You can make your own user interface elements with a few lines of code

Each user interface element has an internal id and title. The id is for you to keep track of the html object that contains the UI so you can change it using javascript, the title is what's seen on the screen. After a UI element has been created you can call it in javascript by id. UI elements have many properties which can be changed during runtime. If you right click -->inspect element -->go to console--> type in the id of your UI element you can see all the UI element object properties. You can change any property using standard javascript. For example to change the width of a widget object whose id is 'jump' you would write jump.style.width='200px' or you could use document.getElementById('jump').style.width='100px'

createButton(id,title,downfunction)

Creates an HTML Button which will call a function when the button is pressed.

Parameters:

name:string id of the html dom element object that contains the momentary button

title:string title

downfunction:string name of function that will be called when the button is changed to down

Example:


function jumpCow(){
	cow1.vel.y=5;
}
createButton("mybutton",'mycowjump','jumpCow');

go to top


createMomentary(id, title,downfunction, upfunction)

Creates an HTML Momentary Button which has two states up and down. When it is pressed down The downfunction is called. When you let go of the button the upfunction is called.

Parameters:

name:string id of the html dom element object that contains the toggle.

title:string title

upfunction:string name of function that will be called when the momentary button is released

downfunction:string name of function that will be called when the momentary button is pressed

Example:


function jetOn(){
	cow1.acc.y=5;
}
function jetOff(){
	cow1.acc.y=0;
}
createMomentary('mycowjetpackmomentary','off/on','jetOff','jetOn';

go to top


createToggle(id,title,downfunction,upfunction)

Creates an HTML Toggle Button which has two states up and down. The upfunction is called when the toggle is switched up, the downfunction is called when the toggle is switched down.

Parameters:

name:stringid of the html dom element object that contains the toggle.

title:string title

upfunction:string name of function that will be called when the toggle is switched up

downfunction:string name of function that will be called when the toggle is switched down

Example:

function jetOn(){
	cow1.acc.y=5;
}
function jetOff(){
	cow1.acc.y=0;
}
createToggle('mycowjetpacktoggle','on/off','jetOn','jetOff';

go to top


createSlider(id, title,functionname, low, hi, step, defaultValue,bounce)

Creates an HTML slider. The function functionname is called when the slider is changed and the value of the slider is sent to the function. You must create a function that receives the value

Parameters:

name:string id of the html dom element object that contains the slider

functionname:string name of function that will be called when the button is pressed

title:string title

low:number The low range of the slider. Will be placed on the low end of the slider

high:number The high range of the slider. Will be placed on the high end of the slider

step:number The slider range is divided by these steps

defaultValue:number The default value of the slider

bounce:true or falseDefault is false. If true when you let go of the mouse it will bounce back to the default value, does not work on Firefox

Example:


function launchCow(value){
	cow1.vel.y=value;
}
createHtmlSlider('mycowlauncher','launch','launchCow',0,10,1,5);

go to top


}

createKey(type,key,functionname)

Bind a key press (down) or release (up) to a named function. The first argument is the event type.

Parameters:

key:string which key is linked to the function

functionname:string name of function that will be called when the key is pressed

Example:

function launchCow(){
	cow1.vel.y=10;
}
createKey('down','j','launchCow')

go to top


removeKey(key)

Removes a key linked to a function

Parameters:

key:key

Example:

removeKey('j')

go to top


createHtmlButton(id,title,functionname)

Creates an HTML button. The function functionname is called when the button is pressed

Parameters:

name:string id of the html dom element object that contains the html button

title:string title will be placed on the button

functionname:string name of function that will be called when the button is pressed

Example:

function launchCow(){
	cow1.vel.y=10;
}
createHtmlButton('mycowjumper','Cow Jump','launchCow')

go to top


createHtmlButtonWithInput(id, title, functionname,default)

Creates an HTML button with a user input field. The user input is send to a function when the button is pressed

Parameters:

name:string id of the html dom element object that contains the html button

title:string will be put next to the input

functionname:string name of function that will be called with the input parameter

Example:


function setGravity(frominput){
		penguin1.acc.y=frominput;
}
createHtmlButtonWithInput('mygravityinput','G-Force','setGravity',-9.81)

go to top


createHtmlTextarea(id,text notimplemented yet fixthis)

Creates an HTML textarea

Parameters:

name:string id of the html dom element object that contains the html button

text:string will be put in the textarea

Example:

createHtmlTextarea('userinput','Type your solution here:')

go to top


createImage(name,src)

Creates HTML Image

Parameters:

name:string id of the html dom element object that contains the image.

src:string The source references an images stored somewhere on the internet. It could be an image you've uploaded to a server. Or you could use a service like imgur to upload an image

Example:

createHtmlImage('einstein','http://www.cinematicsciences.com/images/einstein.jpg');

go to top


createTitle(id,txt)

Creates HTML Text

Parameters:

name:string id of the html dom element object that contains the title

txt:string

Example:

createHtmlTitle('gravitytitle','Gravity Changer')

go to top


createText(id,text)

Creates HTML Text

Parameters:

name:string id of the html dom element object that contains the text

text:string

Example:

createHtmlText('gravitydescription','This allows you to change the gravity.')

go to top


createSelect(id,title,functionname change to func not implemented yet fixthis,optionarray,defaultoption)

Create a standard html select

Parameters:

name:string id of the html dom element object that contains the select

functionname:string name of a function that takes a string parameter that will be called when someone makes a selection

title:string title

optionarray:array A javascript string array of options

defaultoption:string The option you want to be the default option

Example:

createHtmlSelect('gravityselect','gravity',new Array('moon','earth','jupiter','blackhole'),'earth')

go to top


createMeter(id,title,watch,howoften)

Starts a meter that watches something every howoften milliseconds.

Parameters:

id:string id of the html dom element object that contains the meter

title:string title

watch:string like 'cow.vel.y' which will be put in the meter

howoften:number in milliseconds which is how often you want to put points on the chart

Example:

createMeter('mymeter','cow.pos.y',5000);

go to top


createPoints(id,title, xpoint,ypoint,howoften)

Starts listing points of whatever is in xpoint and ypoint every howoften milliseconds.

Parameters:

id:string id of the html dom element object that contains the points

title:string title

xpoint:string like 'cow.pos.x' to be put in the x column

ypoint:string like 'cow.pos.y' to be put in the y column

howoften:number in milliseconds which is how often you want to put points on the chart

Example:

createPoints('mypoints','cow.pos.x','cow.pos.y',1000);

go to top


createChart(id,title,xpoint,ypoint,howoften,
xlow,xhigh,xdivs,ylow,yhigh,ydivs)

Starts a Chart of whatever is in xpoint and ypoint every howoften milliseconds.

Parameters:

id:string id of the html dom element object that contains the chart

title:string title

xpoint:string like 'cow.pos.x' to be put on the x axis

ypoint:string like 'cow.pos.y' to be put on the y axis

howoften:number in milliseconds which is how often you want to put points on the chart

xlow:number lowest range of x-axis

xhigh:number highest range of x-axisyou want to put points on the chart

xdivs:number divisions between xlow and xhigh on x-axis

ylow:number lowest range of y-axis

yhigh:number highest range of y-axis

ydivs:number divisions between ylow and yhigh on y axis

Example:


createChart('mychart','cow.pos.x','cow.pos.y',5000,0,100,10,0,100,10);
//creates a chart which updates every 5 seconds
//has a x-axis range of 0 to 100 in 10 divisions
//has a y-axis range of 0 to 100 in 10 divisions

go to top


AddCommandLine()

Creates a Command Line input and button.

Parameters:

Example:


AddCommandLine();

go to top


CreateHelp(id,title,content)

Creates a help button which pops up helpful information.

Parameters:

id:stringid of the html dom element object that contains the help

title:string title

content:html helpful information in html format

Example:


createHelp('help1','instructions','Instructions
Push the right button to go right
Push the left button to go left');

go to top


Browse all User Interface Elements functions and related commands

Positioning User Interface Items

You can move UI elements around using moveUI() and fixUI() functions. You can save the positions of your UI elements by pasting in the code that is produced by fixUI() after the controls are created.

User Experience Design: Goals, Rewards, Quizzes, Surveys

showPage(url)

Shows any webpage that you've made and that exists on a server or service. Could be an instructions page, a quiz page, or a survey page. The webpage will cover the editor and debugger.

Parameters:

url:string url address of the web page

Example:


showPage('http://www.cinematicsciences.com/instructions.html');
showPage('http://www.surveymonkey.com/quiz.html');
showPage('http://www.surveymonkey.com/survey.html');

go to top


hidePage()

Hides the page

Parameters:

none

Example:

hidePage();

go to top


Browse all User Experience Design: Goals, Rewards, Quizzes, Surveys functions and related commands

Setting Goals for Students

setRepeat(func,time)

Sets a goal for the user

Parameters:

func:string name of the function that checks the goal

time:number How often in milliseconds that you want to check to see if the goal has been reached 1000 milliseconds = 1 second

Example:


//In this example the reward is given while the goal is true. First create a function that checks the goal and gives a reward for reaching the goal. Note this example rewards the user multiple times if the goal condition is still true.
function goalcheck(){
//you give a reward if something is true
if(box1.pos.y>10){
//rewards
showText('you reached the goal','title',5);
coins=coins+100;//add 100 to coins
youWin(10,'goldcoin','box1','You just earned 100 coins');//visual effect
showPage('http://www.secreturl.com');//change page frame
saveSolution();//Offer the user the chance to save their solution.
}
}
setRepeat('goalcheck',1000);

//In this example the reward is given only the first time the condition is true, not every time. First create a function that checks the goal and gives a reward for reaching the goal
var reward=false;//We use a global reward variable to check whether the reward was given or not.
function goalcheck(){
if(reward==false && box1.pos.y>10){
//rewards
showText('you reached the goal','title',5);
coins=coins+100;//add 100 to coins
youWin(10,'goldcoin','box1','You just earned 100 coins');//visual effect
showPage('http://www.secreturl.com');//change page frame
saveSolution();//Offer the user the chance to save their solution.
reward=true;//set to true so no more rewards are given.
}
}
setRepeat('goalcheck',1000);

go to top


deleteRepeat(func)

Deletes a goal by the function name provided when you created the goal.

Parameters:

func:string function name of the goal

Example:

deleteRepeat('mygoal');

go to top


deleteAllRepeats()

Deletes all Goals

Parameters:

none

Example:

deleteAllRepeats();

go to top


youWin(type,text,func)

Shows a text message and releases a number of of a type of object like coins above the target. Use when a goal is reached.

Parameters:

param:numbernumber of objects to release

type:string object type like goldcoin,box

target:string Object name where you want the coins to be released

text:string text you want to show.

Example:


youWin(10,'goldcoin','penguin','You just earned 100 coins');

go to top


Global Variables

There are a few variables that keep track of objects and other variables

objects :array accessed by a number all loaded objects are stored in the objects variable. You can refer to each object by the number order it was loaded starting with 0

Example:


//once you've loaded an object it is stored in the objects variable in order of loading
load('box','box1');
load('box','box2');
//box1 goes in objects[0] 
//box2 goes in objects[1] in order of loading.
objects[0].name; //is box1
objects[1].name; //is box2

go to top


cs :array of all objects and variables accessed by a name all loaded objects and variables are stored in the cs variable. You can refer to these by name.

Example:


load('box','box1');
cs['box1'].name; //is equivalent to box1 

go to top


More Examples:


//see the for loop section for examples of using these global variables to build stacks of blocks.

go to top


find(name)

Sometimes you need to find an object using it's name instead of directly calling it's object. You can use find for that.

name:string a name like 'box1','penguin1','jonathan'

find('penguin');//is equivalent to typing penguin
find('box1').pos.y=10;//is equivalent to box1.pos.y=10;
find('box'+1).pos.y=10;//is equivalent to box1.pos.y=10;
//an example of using a for loop and find to change the pos.y of 10 boxes
for(var i=0;i<10;i++){
  find('box'+i).setPosition(0,i*2,0);
}

go to top


Vectors and Rotation Math

vector(x,y,z)

To position something we use a vector. A vector holds numbers for each dimension in space. In 3D we use x,y,z. The positive x direction is to the right. The positive y direction is up and the positive z direction is out of the page.

x:number
y:number
z:number

var v=vector(1,2,3);
box1.pos=vector(0,0,0);

go to top




//vector functions
function distance(vec1,vec2){
    var x=vec1.x, y=vec1.y, z=vec1.z;
    var x1=vec2.x,y1=vec2.y,z1=vec2.z;
    
    return Math.sqrt((x1-x)*(x1-x)+
                     (y1-y)*(y1-y)+
                     (z1-z)*(z1-z));
};

function addVec(vec1,vec2){
	vec=vector(vec1.x+vec2.x,vec1.y+vec2.y,vec1.z+vec2.x);
	return vec;
}

function subtractVec(vec1,vec2){
	vec=vector(vec1.x-vec2.x,vec1.y-vec2.y,vec1.z-vec2.z);
	return vec;
}

function multiplyVec(vec1,n){
	vec=vector(vec1.x*n,vec1.y*n,vec1.z*n);
	return vec;
}

//more quaternion and functions are available in quaternion.js
//Copyright (c) 2017, Robert Eisele Dual licensed under the MIT or GPL Version 2 licenses.
//the source is located at whimsica.com/quaternion.js or the current url/quaternion.js
//quaternion.js has not been altered in any way.

//note you may have to convert our vector and rotation format into quaternion.js vector
//before using the quaterion.js functions.
//feel free to use your own math library see the section: Integrate another javascript library into your project:

setRotationType(string)

Set the rotation type to euler or quaternion. Eulers are traditional vectors with x,y,z rotations. Asking for the current euler rotation can give back unpredictable results because there is more than one way to describe a rotation using x,y,z. Quaternions have 4 parameters: x,y,z,w and are more reliable for advanced rotation mathematics. You can use one or the other but not both at the same time. The default is Euler Angle Rotations

string:euler/quaternion euler or quaternion

Example:


setRotationType('euler');

go to top


eulerToQuaternion(vector)

Convert an euler vector rotation into a quaternion.

vector:vector vector with x,y,z components

Example:


vec=new vector(0,90,0);
var newquat=eulerToQuaternion(vec);
console.log(newquat);

go to top


quaternionToEuler(Rotation)

Convert an euler vector rotation into a quaternion.

Rotation:Rotation rotation with x,y,z,w components

Example:


rot=new Rotation(0,0,0,1);
var newEuler=quaternionToEuler(rot);
console.log(newEuler);
//Note CS uses a simple Vector4 called Rotation. If you are using a mathematics package that has quaternions that are not simple vector4's -- some are objects with multiple properties, then you'll have to take the x,y,z,w components and assign them to a CS Rotation. 
quat=Quaternion from some mathematics package that does not use a simple Vector4 structure;
newrot=Rotation(quat.x,quat.y,quat.z,quat.w);

go to top


Browse all Vectors and Rotation Math functions and related commands

Integrate another javascript library into your project

Example:


addScript('http://www.someserver.com/somecode.js');//The location has to be on a server somewhere and the file type has to be .js. 

//addScript only works with .js files. Many C and C++ libraries can be converted into .wasm webassembly libraries with Emscripten.  To use .wasm libraries you will need to add webassembly loading code at the beginning of your script.

go to top


Browse all Integrate another javascript library into your project functions and related commands

Interactive Fiction Programming

Interactive Fiction Programming is not implemented yet but you can see the source code in jag2081.js. To start up the interactive fiction module run startJag();



Javascript Programming Basics

Before you start programming in Cinematic Sciences you need to learn the language that the computer speaks. In Cinematic Sciences the computer speaks JavaScript.

This is a quick lesson in JavaScript.
You can paste the code into the CS editor and press run to see what it does.

Comments

When you see two slashes // in front of a line the computer will treat the line as a comment and ignore it.
Programmers use comments to ignore lines of code and to help remind themselves how to understand the code.


//the first load function will not run because it is ignored as a comment.
//load("penguin","peng");
load("penguin","peng");

Variables:

Variables are like boxes that you store stuff in.

Example:

var mybox=5;

Here's a variable called mybox that I put the number 5 in it. The computer puts whatever is on the right side of the = into the variable.

In JavaScript = does not mean mathematical equals.
In JavaScript x=5 is an instruction that says put 5 into x

We can also put text into variables. In computer science text is called a string. You can think of it like letters connected by a string like this: H-e-l-l-o--W-o-r-l-d. A string is is always in quotes.Here is an example of a string variable:

Example:

var mystring= 'Hello world!';

go to top


Outputs

To see what's in a variable you can use alert or log or console.log. Alert pops up a box on the screen, log writes the output to the debugger, console.log writes to the browser console. You can look up online how to open up the console.log for your browser.

Example:


alert(mybox);
//will output 5
log(mystring);
//will output 'Hello world!'

go to top


You can mix strings with variables in an alert statement using the '+' symbol

Example:


var mybox=5;
alert(mystring +' I have ' + mybox + ' cents');
//will output 'Hello World! I have 5 cents');

go to top


Arrays

You can store a list of things in a variable. In JavaScript a list is called an Array. Here are some arrays.

Example:


var mynumbers=new Array(1,2,3,4,5);
var myslangWords=new Array('cool','chill','hot doggy');
var myintroductions=new Array('Hi!','Wassup','Yo');

go to top


To get an item from an array you use a number in brackets like this [2].

Example:


var mynumbers=new Array(0,1,2,3,4,5);
alert(mynumbers[2]);
//will output: 2
//Note arrays count from 0 not from 1 [0] is the first item in the array [1] is the second item.
//if you are having problems with your arrays you may not be counting from 0.

go to top


To put an item in an array you just tell where to put it with a number in brackets like this [8].

Example:


var numbers=new Array(0,1,2,3,4,5);
numbers[8]=1000;
alert(numbers);
//will output: 0,1,2,3,4,5,,,1000;

go to top


An Array can be filled with objects strings,numbers, or even other arrays.You can add items to an array and remove items from the array. Or you can look through it using a which is discussed below

Objects

You can also store an Object in a variable. An Object is something that has properties. Wheverer the object goes the properties go with it. Each property is linked to the object with a '.'

Example:


mycar=new Object();
mycar.wheels=4;
mycar.color='blue';
mycar.model='Porsche';
mycar.owner='me';

go to top


To output the color of car you can use an Alert or send it to the log using log. Alert and log are used to see what's in a variable.

Example:


alert(mycar.color);
//will output 'blue'
log(mycar.owner);
//will output 'me'

go to top


if then else

An if then else statement tests whether or not something is true, called a condition, then does something if it is. For example if the condition is that it's a school day, then you go to school, else you go play. Here are some examples:

Example:


var mydice=6;
if(mydice>4){
	alert('You Win')
}
else{
	alert('You Lose');
}
//outputs 'You Win';
 

go to top


Example:


var name='fred';
if(name=='fred'){
	alert('Hi Fred');
}
else{
	alert('I don't know you');
}
}
//outputs 'Hi Fred'
 

go to top


Example:


var classmates=new Array('joe','moe','robert');
if(classmates[0]=='joe'){
	alert('Yo Joe!')
}
//outputs Yo Joe!
 

go to top


Example:



var car=new Object();
car.color=blue;
car.owner='rob';
}
if(car.owner=='rob'){
	alert(car.owner + ' owns the ' + car.color + ' car')
}
//output rob owns the blue car
 

go to top


Note: To test whether or not something is true you can use equals ==, not equals !=, greater than >, and less than <. You can also string together if statements with the symbols && for And, and || for Or.

Example:


var dice1=5;
var dice2=2;
if(dice1==5&&dice2==2){
	alert('You rolled a 7')
}
//output You rolled a 7
 

go to top


For loop

A for loop will run the code inside the loop brackets {} according to the 3 rules in the parantheses (). The rules include where to start, when to end, and how to count. For loops are often used to check every item in an array, or do something to every item in an array.

Example:


for(var i=0;i<10;i++){
	alert(i);
}

go to top


The for loop controls have 3 parts separated by a ';'

The JavaScript for loop structure will run any code inside the loop brackets according to the for loop controls.

More Examples:


//load a stack of boxes using the global variable named objects
for(var i=1;i<10;i++){ load('box','box'+i);
objects[i].ontop(objects[i-1]);
}
//load a stack of boxes using the global variable cs
for(var i=1;i<10;i++){
load('box','box'+i);
n=i-1;
cs['box'+i].ontop(cs['box'+n]);
}

//load a stack of boxes using your own array named boxes
boxes=new Array();
for(var i=1;i<10;i++){
load('box','box'+i);//stored in objects
boxes[i]=objects[i];
boxes[i].ontop(boxes[i-1]);
}

go to top


A while will loop will run whatever is inside as long as the condition statement is true

Example:


while(cow.animation=='eat'){
	log('the cow is eating');
}

go to top


Functions

A function is like a set of instructions that you would give to someone to tell them how to do something. For Example: Brush your teeth. If you put it on paper it might look something like this: First get toothpaste, put it on the toothbrush,open your mouth, Put the toothbrush in your mouth, move the toothbrush around on your teeth, spit out the toothpaste, rinse your mouth with water. Put the toothbrush down. In JavaScript this would look like this

Example:


function brushTeeth(){
	getToothpaste
	PutToothpasteOnToothbrush
	OpenMouth
	etc...
}	

go to top


To call the function in JavaScript you would just write the name of the function and add () to the end.

Example:


brushTeeth();

go to top


Functions make it easy to tell the computer to do long lists of instructions. Here's a real JavaScript function that multiplies two numbers together

Example:


function multiply(){
	var a=5;
	var b=5;
	alert(a*b);
}
multiply();//you have to call the function to run it.

go to top


Functions can take in information and use it. The () in front of the function can be filled with variables separated by commas. You can send information into these variables when you call the function. The function can then do different things depending on the information that is sent into the variables. For example:

Example:


function multiply(a,b){
	alert(a*b);
}
multiply(3,5);//you have to call the function to run it.

go to top


A function with if else:


function givePromotion(name,age,rank){
	if(rank=='level0'&&age>20){
	alert(name + ' gets a promotion!');
	}
	else{
	alert('Sorry '+name + ' does not get a promotion.');
	}
}
givePromotion('Katherine',22,'level0');
//output Katherine gets a promotion!
givePromotion('David',18,'recruit');
//output David does not get a promotion.

go to top


A function with an array and a for loop


function inClass(studentname){
myClass=new Array('Jameel','Walter','Katherine');
//loop through all the students
for(var i=0;i< myClass.length;i++){
	//loop through the array to see if each students is in the class
if(myClass[i]==studentname){
alert(studentname+' is in the class!');
}
}
}
inClass('Katherine');//output: Katherine is in the class!

go to top


Functions can return values. A function with the word return in it will return whatever is after the return. For example:

Example:


function add(a,b){
return a+b;
}
var answer=add(3,5);//will return 8 and put it into the answer variable
alert(answer);
//output answer=8

go to top


Problems and Troubleshooting

When your script has code that the computer cannot understand the debugger will show the error. The Debugger is located below the editor.

The debugger will try to tell you what it thinks the error is and also what line it is on. The debugger is not perfect. Think of the debugger is giving you clues to solve the mystery of what's wrong with your code, but it may be slightly or majorly wrong about the location. If it says there is an error on line 20, also look around on line 19 and 21 also. If it says the error is on line 1 and you don't see an error on Line 1 Look for missing () {} and '' anywhere on the page. Then look for words that are not quite right like 'box' when it should be 'box1'. Sometimes the debugger will say something cryptic -- you can always look up that error on google or stack-overflow for a better explanation of the error.

The debugger is just one way to see what's wrong with your code. Another way is to open the console log on your browser. I do this by right clicking on anything on the screen then going to inspect element and then choosing 'console' This brings up a whole panel for developers. If you find the word console and click on it, it will have every error that the entire program is making not just your code. This may give you clues also. You are looking for syntax errors. At the bottom of the console is place where you can type. If you type in a variable name it will show you all the properties of that variable. You can also type in javascript. For advanced users you can see and change properties. Start typing top.webgliframe. For example if have an object named penguin it would be top.webgliframe.penguin. to see all the properties and variables that penguin has. If you have created a button named button1 you would use top.webgliframe.button1 to see all the properties.

A common error is An abnormal situation has occurred: the PlayerLoop internal function has been called recursively.
Restart the page using the restart button on the page across from the docs tab. If that doesn't work you'll have to refresh the page itself. If that doesn't work you'll have to quit the browser and start it up again.

For loops and while loops that never end can hang your browser. If your browser stops responding there is something in your code that is running and won't stop. Refresh the page and check the stop conditions on your for loops and while loops. Another thing that can cause an infinite loop is a function which calls another function which calls the original function, or a function that calls itself.

If your project seems to be choppy, remove unnecessary log() or console.log() calls. These can slow down the browser. Comment them out and see if the project runs more smoothly.

If your program is frozen or unresponsive see if one of these will fix the problem:

  1. So you don't lose your work, copy your script by selecting it and going to edit-copy. Paste your script somewhere on your computer so you have a copy of it.
  2. Hit the restart button to the right of the About tab.
  3. Find the refresh button for the browser that will reload the page. Google if you're not sure where it is.
  4. Close the browser window.
  5. Quit the browser and start it up again.
  6. Clear the history and cache of the browser. Google if you are not sure how to do this.
  7. Force the Browser to Quit
  8. Post your code and ask a question about why it doesn't work on StackOverflow.com

Tutorials

Tutorial Link Test

This section is not working yet. Tutorial links coming soon

Here you go step1 of the Build a game tutorial

Here you go step2 of the Build a game tutorial


//hit run to start
//then hit instructions
//then hack the code

//load objects
load('penguin','penguin',-5,1,0);

//create tower
load('box','box0');//start box
box0.scale=vector(2,2,2);

//loop to add 9 more boxes 
for(var i=1;i<10;i++){
load('box','box'+i);
find('box'+i).scale=vector(2,2,2);
ontop('box'+i,'box'+(i-1));//calculation (i-1) must be in parenthesis
find('box'+i).rot.v=vector(0,0,0);
}

//cameras
setCamera('penguin','follow',50,0,1,20);
dynamicZoomOn('penguin','box9');

//user interface
createHelp("myhelp","instructions","Drag the penguin's hands legs or feet and try to land on top of the stack of blocks for 10 seconds.")
createHelp("myhelp","instructions 2","Can you knock out only the bottom block? 
You can change physics by typing code into the command line.
For example: penguin.mass=10;
box0.setFriction(1)
box0.mass=2
See the docs-->physics for more info.") startTimer("yvel");//this should to be in place before we create the chart createButton('myreset','reset','clearRun()'); //createChart to be last due to some mywidget bug createChart("vel","velocity","getTimer('yvel')/500","penguin.vel.y",500,0,100,10,-20,20,5) //functions function reset(){ checkstacktimer=0; createInterval('checkStack',1000); box0.pos=vector(0,1,0); box0.vel=vector(0,0,0); box0.angvel=vector(0,0,0); for(var i=1;i<10;i++){ find('box'+i).rot=vector(0,0,0); find('box'+i).vel=vector(0,0,0); find('box'+(i-1)).rot=vector(0,0,0); ontop('box'+i,'box'+(i-1)); } penguin.pos=vector(-5,1,0); penguin.vel=vector(0,0,0); } createInterval('checkLanding',1000); collisionWatch('penguin','box9','onEnter','onExit'); landedTimer=0; landed=false; function onEnter(){ landed=true; //log('landed'); } function onExit(){ landed=false; landedTimer=0; //log('left'); } function checkLanding(){ if(landed==true){ landedTimer+=1; } if(landedTimer==10){ youWin(10,'goldcoin','penguin','You just earned 10 coins');//visual effect showText("You Win",5,"bold"); } //log('landedTimer='+landedTimer); } //extras //to measure acceleration we don't use object.acc because that is what is applied //to the object each frame. //instead we have to actually measure the change in velocity over time. //pVy=0; //var measuredacc=0; //createInterval("getAcc",250); //function getAcc(){ // vy1=penguin.vel.y; // measuredacc=vy1-pVy; // measuredacc=measuredacc*1000/250;//the denominator is the interval rate // pVy=vy1; // log(measuredacc); //} //startTimer("yvel"); //createChart("vel","acceleration","getTimer('yvel')/500","measuredacc",500,0,100,10,-20,20,5)

go to top


Faq's

How do I save my work.

Pressing the save button above the editor will download what's in the editor to your hard drive.

How do I share my project with someone?

You can send them the code to paste into the editor, or you can put the code up on server and load it from a link.
Example: https://cinematicsciences.com?url=yourservername.com/yourgame.js

This seems kind of buggy. I have to press Run more than once sometimes.

We're still getting the bugs out after switching to the Unity platform. It's getting more stable each week.

I thought there would be more content.

We're porting content from the original version and new content every month. Look for more content in our monthly updates.

Can I add my own models?

We're currently looking into the ability to add your own models and experimenting with different formats. Look for this capability in future releases.

Some of the features in the documentation are not working.

If you find something that is not working correctly or documented incorrectly, you can email a message to us, or post a question on stack overflow.

Are you going to have a community of developers who can talk to each other.

We're looking into that for future releases.

Drawing terrain

Terrain brushes use world x and z coordinates and a radius in metres. They work through CS; the Unity editor is not needed.

createTerrain("ground", 100, 100, 30);
raiseTerrain("ground", 20, 20, 10, 3);
smoothTerrain("ground", 20, 20, 12, 0.5);
setTerrainColors("ground", "#608a35", "#d4bc84");
paintTerrain("ground", 40, 30, 8, 1);

The last line paints layer 1 around (40,30), using an 8-metre radius. Repeat brushes along a route to draw a beach or path. Other commands are lowerTerrain(name,x,z,radius,amount), flattenTerrain(name,x,z,radius,height), and generateTerrain(name,seed,amplitude). Lowering cannot go below the terrain's minimum height.

setTerrainTextures(name, grassUrl, sandUrl) sets up texture layers. Up to four layers are supported, numbered from zero. Setup replaces existing painting; do it before painting. The team can use setTerrainTexture(name,layer,url,normalUrl,tileSize) to replace a single texture and preserve the painted layout. This complete operation must finish before another edit to that terrain.

The advanced setTerrainLayers interface also supports normal maps, tiling, smoothness and metallic settings. setTerrainSplatmap accepts a complete grid of texture weights calculated by the team. Students do not need to write those arrays manually. Terrain snapshots save the textures and painted weights with the movie set.

Browse all Terrain functions and related commands

Water and paths

Create water with a name. Optional sizes are in metres.

createPool("pool");
createPond("pond");
createOcean("sea");

Change it with simple commands. These statements run in order automatically.

createPool("pool", 8, 12);
moveWater("pool", 10, 0, 20);
setWaterWaves("pool", 0);
setWaterColor("pool", "#268caa");
CommandWhat it does
moveWater(name, x, y, z)Move the centre to a position.
sizeWater(name, width, length)Resize the water.
rotateWater(name, degrees)Turn it around its centre.
shapeWater(name, points)Set an outline using a list of [x,y,z] points.
setWaterWaves(name, height)Set waves from 0 to 2; 0 is still.
setWaterColor(name, color)Set a colour such as "#268caa".
setWaterFlow(name, speed)Set surface flow from 0 to 4.
setWaterRipples(name, strength)Set small ripples from 0 to 1.
setWaterClarity(name, amount)Set absorption from .001 to 5; lower looks clearer.
setWaterDetail(name, triangleSize)Set triangle size from 1 to 256; larger uses fewer triangles.
refreshWater(name)Rebuild water depth data after changing the beach, bed or colliders.
removeWater(name)Remove the water.

Custom outlines can be concave, like this L-shaped pool. Keep every point at the same height and do not repeat the first point at the end.

createPool("pool");
shapeWater("pool", [[0,0,0], [0,0,10], [5,0,10], [5,0,5], [10,0,5], [10,0,0]]);

Use one command for rivers, roads and trails. A name and a kind create a straight 20-metre path.

createSpline("stream", "river");
createSpline("street", "road");
createSpline("path", "trail");

For a curved route, give a list of [x,y,z] points and an optional width.

createSpline("stream", "river", [[0,0,0], [10,-1,20], [20,-2,40]], 5);
setSplineWidth("stream", 8);
setSplineFlow("stream", 0.5);

Other path commands: setSplinePoints(name, points), setSplineWidths(name, widths), moveSpline(name, x, y, z), rotateSpline(name, degrees), and removeSpline(name). To lay a road or trail on existing terrain, use followSplineTerrain("path", "ground"). This follows the ground without flattening it.

Water surfaces need a separate pool basin, pond bed or seabed. They do not dig the ground or add floating-object physics. Water and paths save and reload with the movie set.

For scripts that need to inspect geometry, getWater(name), listWaters(), getSpline(name), and listSplines() return Promises containing the specifications, bounds and mesh counts. Ordinary creation and editing statements do not need Promise syntax.

Browse all Water and paths functions and related commands

Source-reviewed CS commands

These commands use the CS JavaScript interface. For commands that return a Promise, await completion before dependent work inside an async function. Do not use Unity C#, Rigidbody APIs or three.js in a CS game.

Reference checked against JavaScript and reached Unity source. The running player must include the corresponding capabilities; source review is not a live gameplay test.

load

load(type, name, x = 0, y = 2, z = 0, rx = 0, ry = 0, rz = 0)

Purpose: Create a stock CS actor from a preloaded asset-bundle prefab, with its existing CS setup and physics components.

Arguments and limits: Use a supported stock type and a unique simple JavaScript identifier for name. Use a quoted literal type directly after load( in editor source, such as load("penguin", "penguin"); the current preload scanner looks for that spelling. Dynamic type variables, aliases or whitespace immediately after the opening parenthesis are not discovered by that scanner. Pass finite numeric positions/rotations. This is not a Sketchfab or GLB import command.

Result: undefined, not a Promise or an actor object. The type-specific setup callback creates the named JavaScript actor; do not assign var penguin = load(...) or assume await load(...) waits for setup.

Effects: Sends jLoadObject with name/type/position/rotation. Unity instantiates an already-loaded prefab, registers it in the CS actor/shared-memory system and calls its type-specific JavaScript Setup function. This does not convert an arbitrary imported model into a CS actor. Read actual mass after initialization instead of inferring it from the default JavaScript fields.

Completion: During normal editor execution, the preload scanner sends ReceiveModelList first; Unity downloads missing bundles and calls Run only after success. The load wrapper itself only requests instantiation and has no completion protocol. The JS actor becoming visible is separate from all prefab physics/joint initialization completing. Do not treat actor.loaded or a fixed arbitrary delay as a generic readiness guarantee.

Coordinates: Initial x/y/z are passed unchanged into Unity prefab instantiation; Y is up and rotations are Euler degrees. Later legacy CS actor pos.x is mirrored relative to Unity world X. Do not assume initial load coordinates and subsequent shared-memory coordinates have identical X conventions.

Requires: Use the normal editor run/preload path with the requested stock bundle available. A direct load call outside that path can fail if the bundle was not preloaded. The receiver logs a missing-prefab error rather than rejecting a JavaScript Promise.

Save and cleanup: Stock actors belong to the game script, separate from movie-set scenery. Recreate them through the game's normal run/reset lifecycle. The movie-set manifest does not replace the actor-loading script.

load("penguin", "penguin", 0, 2, 0);
load("jeep", "jeep", 5, 2, 0);

actor.setFriction

actor.setFriction(value)

Purpose: Change friction on an existing CS actor's collider. Substitute the actor's chosen name for actor.

Arguments and limits: Pass a finite numeric coefficient. The wrapper and receiver do not validate a range or clamp the value. The named root must exist and have a Collider; the receiver does not add a missing collider.

Result: undefined; no completion Promise or returned material.

Effects: Sets root staticFriction and dynamicFriction to value and root frictionCombine to Minimum. For an actor with the dancer component, also sets static/dynamic friction on active child colliders; it does not change those children's combine settings. It does not traverse every wheel or child collider of all other actor types.

Completion: Fire-and-forget SendMessage to jsetFriction; the receiver yields a frame. Awaiting this JavaScript method does not wait for that Unity change.

Coordinates: Scalar material coefficient; no position or axis convention applies.

Requires: Loaded CS actor with a root collider and a player containing jsetFriction. Ordinary GLB scenery has a separate interface; an explicitly promoted GLB CS actor has the required root collider.

Save and cleanup: Live physics material change on the actor, not a movie-set setting. Reapply through game initialization if needed after reloading actors.

// After box1 has loaded:
box1.setFriction(0.4);

actor.setElasticity

actor.setElasticity(value)

Purpose: Set an existing CS actor collider's bounciness.

Arguments and limits: Pass a finite numeric value. Neither wrapper nor receiver validates/clamps its range. The named root must already exist and have a Collider.

Result: undefined; no Promise or completion receipt.

Effects: Sets root material bounciness and root bounceCombine to Average. For dancer actors, also sets bounciness on active child colliders without changing their combine modes. Other compound actors' child colliders are not all updated by this receiver.

Completion: Fire-and-forget SendMessage; receiver yields one frame before changing materials. Await does not establish completion.

Coordinates: Scalar material setting, not a velocity or force.

Requires: Loaded CS actor with root Collider and jsetBounciness support in the player.

Save and cleanup: Actor material change; reapply after loading actors as needed. Not part of scenery/movie-set export.

// After ball has loaded:
ball.setElasticity(0.3);

actor.freeze

actor.freeze()

Purpose: Make an existing CS actor root Rigidbody kinematic.

Arguments and limits: No arguments. Requires the named root and its Rigidbody to exist. This is a deliberate physics-mode change, not a generic readiness, loading, seating or placement helper.

Result: undefined; no completion Promise.

Effects: Sets root Rigidbody isKinematic true and collisionDetectionMode Discrete; sets the optional physics component's kinematic flag true. It does not freeze every child Rigidbody of an articulated actor. The wrapper does not capture prior settings for restoration.

Completion: Fire-and-forget SendMessage; receiver yields a frame. Awaiting the method is not a completion acknowledgment.

Coordinates: No coordinates. This changes physics mode rather than merely setting a position.

Requires: Loaded CS actor with root Rigidbody and jsetKinematic receiver. Do not freeze a drivable Jeep or its passenger as a workaround for seating or initialization.

Save and cleanup: Live actor setting, outside movie-set storage. actor.unfreeze() makes the root dynamic with its own fixed defaults; it does not restore an arbitrary prior configuration. Exception for explicitly promoted GLB actors: the movie-set body descriptor records the current dynamic/kinematic mode; stock actor setup remains in the game script.

// Only when this actor is intentionally meant to become kinematic:
box1.freeze();

actor.unfreeze

actor.unfreeze()

Purpose: Make an existing CS actor root Rigidbody dynamic again.

Arguments and limits: No arguments. Requires an existing root Rigidbody. This is not a general repair command for a stalled car, and it does not clear Rigidbody constraints or joints.

Result: undefined; no completion Promise.

Effects: Sets root isKinematic false, collisionDetectionMode ContinuousDynamic and interpolation None. Sets the optional physics component's kinematic flag false. Does not recursively restore child bodies or recover the exact settings that preceded freeze().

Completion: Fire-and-forget SendMessage, with a one-frame receiver yield. Await does not wait for the Unity update.

Coordinates: No coordinate arguments; changes the actor's physics mode.

Requires: Loaded CS actor with root Rigidbody and jsetKinematic support.

Save and cleanup: Live actor setting; not saved with scenery. Initialization should intentionally choose physics behavior rather than indiscriminately freeze/unfreeze all objects. Exception for explicitly promoted GLB actors: the movie-set body descriptor records the current dynamic/kinematic mode; stock actor setup remains in the game script.

// When the intentionally frozen box should resume dynamics:
box1.unfreeze();

actor.setConstraints

actor.setConstraints(value)

Purpose: Set one of the two constraint modes implemented by the legacy CS actor wrapper.

Arguments and limits: The implemented strings are exactly "z" and "none". Other strings are silently ignored by this receiver; do not invent x/y/rotation/all options or pass Unity enum names. The underlying helper also returns without applying changes when the global ccdtype is "ape".

Result: undefined; no Promise, success flag or error for unsupported strings.

Effects: "z" replaces the root Rigidbody constraints with FreezePositionZ only; "none" replaces them with None. These assignments replace prior rotation constraints too. They do not toggle isKinematic, freeze all child bodies or remove joints.

Completion: Fire-and-forget SendMessage to jsetConstraints. The receiver yields a frame, so awaiting the JavaScript call does not establish completion.

Coordinates: Root Rigidbody Z-position constraint. This is a constraint mode, not a movement command.

Requires: Loaded CS actor with a root Rigidbody. Consider prefab defaults before clearing constraints; characters may intentionally be constrained for a particular game.

Save and cleanup: Live actor state, not a movie-set setting. Reapply only if intended after actor reload; do not clear constraints indiscriminately to work around unrelated bugs.

// If box1 should move freely in all three dimensions:
box1.setConstraints("none");

getSceneObject

getSceneObject(name)

Purpose: Read a named scenery object's current transform and world bounding box.

Arguments and limits: Name must belong to the scenery runtime. A stock actor made with load(type,name) is a different registry and is not measured by this function. Bounds combine all child renderers, including inactive children, into an axis-aligned world box; they are not exact collision geometry.

Result: Promise resolving to the scenery item: name, URL, kind, collider, position, rotation, scale, boundsCenter, boundsSize, and saved motion/animation/path/body/hinge settings. Position and rotation are current root transforms; scale is root localScale. Bounds depend on current renderer geometry and orientation. Promoted GLB props remain in this registry and additionally return csObject:true and actor:{version:1,type:"glb",acceleration:{x,y,z}}; acceleration is Unity additional acceleration and body contains live Rigidbody settings.

Effects: Read only. Renderer extents may include empty space around irregular or rotated objects.

Completion: Returns a Promise; await the item. A scene transport timeout leaves the command outcome unknown.

Coordinates: Unity world metres, Y up; rotation is Euler degrees. These scenery coordinates do not use the legacy CS actor X mirror.

Requires: Loaded scenery registered by the scene runtime and a player supporting jSceneCommand/get.

Save and cleanup: getSceneState uses the same item format when exportMovieSet captures scenery. This read does not save a file or embed GLB bytes.

var dock = await getSceneObject("dock");
var width = dock.boundsSize.x;
var bottom = dock.boundsCenter.y - dock.boundsSize.y / 2;

getSceneState

getSceneState()

Purpose: List the scenery runtime's registered objects with their current transforms and bounds.

Arguments and limits: Only scene-runtime objects are listed. This is not the entire Unity hierarchy and does not include legacy CS actors, terrain records, environment records or blocking markers. Objects whose roots have been destroyed are skipped; there is no ordering guarantee. Explicitly promoted GLB actors remain scene-runtime objects and are included; their csObject/actor descriptor distinguishes them from ordinary scenery.

Result: Promise resolving to an array of scenery items in the getSceneObject format, including current position/rotation/scale, boundsCenter and boundsSize.

Effects: Read only. Bounds are combined axis-aligned renderer bounds, including inactive children, rather than exact collision shapes.

Completion: Await the Promise before using the array. A timeout does not prove the scene is empty.

Coordinates: Unity world metres, Y up, Euler degrees; no legacy actor X mirroring.

Requires: Player supporting the jSceneCommand/list scene runtime operation.

Save and cleanup: exportMovieSet includes this array as objects, alongside separately exported terrain, environment and markers. URLs reference assets; the array contains no asset file bytes. On restoration, promoted items must be imported first and re-registered before use as CS actors; the descriptor does not contain gameplay functions or input bindings.

var scenery = await getSceneState();
for (var i = 0; i < scenery.length; i++) {
    console.log(scenery[i].name, scenery[i].boundsSize);
}

groundModel

groundModel(name, terrain, x, z, embed = 0, alignToTerrain = false)

Purpose: Re-seat one scenery object on the current terrain using its renderer bounding-box bottom.

Arguments and limits: Requires an existing scenery object and a named Unity terrain. X and Z must be inside its bounds; embed must be finite and between 0 and 100 metres. The root moves to x/z, and the box bottom is placed at the terrain height sampled there minus embed. This samples one point, not every contact beneath the object's footprint. Whole-model transform changes are rejected while independent part rigidbodies exist.

Result: Promise resolving to the updated scenery item with current transform and bounds.

Effects: One-time root transform edit followed by physics synchronization. With alignToTerrain true, align the object's up direction to the sampled terrain normal and retain its prior yaw; prior pitch/roll are replaced. This does not create continuous terrain-following, a joint, or a physics controller. Use after sculpting when an object needs re-seating, not repeatedly to drive a dynamic actor.

Completion: Await completion before measuring or making dependent edits. A timeout means the outcome is unknown; inspect current state before retrying.

Coordinates: World X/Z and metres; Y up. Positive embed seats the bounding-box bottom below the sampled surface. Scenery coordinates are not mirrored like legacy actor X positions.

Requires: Player with the groundModel scene capability, registered scenery and an existing Terrain. Does not operate on a legacy CS stock actor by name. This scenery transform operation rejects objects already promoted with makeCSObject. Use documented actor position/rotation/scale for intentional placement/reset after promotion, and physics for ongoing motion.

Save and cleanup: Updated scenery transforms are captured by subsequent getSceneState/exportMovieSet. Re-ground after later terrain edits; existing placement does not automatically track sculpting.

await groundModel("rock1", "island", 40, 60, 0.15, true);

measurePlacement

measurePlacement(name, terrain = "", other = "")

Purpose: Measure one scenery object's coarse relationship to terrain and another scenery object.

Arguments and limits: Name and nonempty other must identify registered scenery. Nonempty terrain must name an existing Terrain, and the model bounding-box center must lie within its X/Z bounds. Blank optional names omit those measurements. Default zero fields for an omitted measurement are not proof of contact.

Result: Promise resolving to name and principalAxis. With other: other, centerDistance, surfaceDistance and overlaps using world axis-aligned boxes. With terrain: terrain, groundHeight, groundGap and penetration, where groundGap is box bottom minus terrain height at the box center and penetration is max(0,-groundGap).

Effects: Read only. Overlapping boxes may enclose empty space and do not prove mesh collision. Ground gap samples just the center, so it cannot certify all legs, corners, wheels or a long dock are supported. Combine measurements with other sample points and multiple camera views.

Completion: Await the Promise. Failure to measure is not a successful realism review.

Coordinates: World metres, Y up. Positive groundGap means the box bottom is above the sampled terrain; negative means below it. surfaceDistance is box-to-box distance, not nearest mesh-surface distance.

Requires: Player supporting measureRelationship in the scene runtime. This function does not measure legacy stock actors or the ocean surface. A GLB promoted with makeCSObject remains measurable through the scene registry; returned geometry uses Unity coordinates, not mirrored CS actor X.

Save and cleanup: Measurement only; does not move an object or save a scene. Re-measure after placement, scaling, rotation or terrain edits.

var placement = await measurePlacement("rock1", "island");
console.log(placement.groundGap);

getModelAxis

getModelAxis(name)

Purpose: Estimate a scenery model's dominant horizontal geometric axis for alignment work.

Arguments and limits: Name must identify registered scenery. The estimate samples MeshFilter vertices in world X/Z, with a stride based on about 2000 vertices per mesh. It does not infer the object's semantic front, entrance, direction of travel, or support points. Skinned-only geometry is not included in this vertex calculation.

Result: Promise resolving to a normalized horizontal vector {x,y,z}, with y = 0. Axis sign is ambiguous. With fewer than two sampled vertices it falls back to horizontal root forward, or world forward if that is degenerate.

Effects: Read only. Nearly symmetric shapes can have unstable or unhelpful principal directions; inspect from multiple views before choosing orientation.

Completion: Await the Promise before using the vector.

Coordinates: World horizontal direction, not Euler angles or a local-space facing vector.

Requires: Player supporting principalAxis in the scene runtime and an existing scenery object. A GLB promoted with makeCSObject remains measurable through the scene registry; returned geometry uses Unity coordinates, not mirrored CS actor X.

Save and cleanup: Computed on request; does not change or save the model.

var axis = await getModelAxis("dock");
console.log(axis.x, axis.z);

jeep.setSteering

jeep.setSteering(angle)

Purpose: Steer a loaded stock Jeep through its physics joints. Replace jeep with the name chosen when loading that Jeep.

Arguments and limits: Supply a finite angle in degrees. JavaScript uses parseFloat; Unity clamps to -60..60. Zero requests straight steering. This is a method: assigning jeep.setSteering = 10 overwrites the method. The steer(angle) method is an equivalent wrapper; jeep.steer = 10 also overwrites a method.

Result: undefined; no Promise or completion acknowledgment.

Effects: Updates the targetRotationXYZ of the two front steering joints. Does not teleport, freeze or parent the vehicle. This target alone does not guarantee a particular turning radius or stable driving at every speed.

Completion: Fire-and-forget SendMessage. Wait for normal stock-object loading before calling. The receiver's initialization check yields once, so calling early is not a supported readiness strategy.

Coordinates: Degrees interpreted by the Jeep steering joint setup. Test left/right behavior with the loaded prefab; this is not a world-space transform rotation.

Requires: A stock Jeep created through CS load(type,name), with jeepSetup completed and the expected Jeep joints present. A static GLB shaped like a Jeep does not acquire these methods or physics.

Save and cleanup: A live actor control, not scenery or movie-set data. Apply controls through game code after loading the actor; use zero when straight steering is desired.

// After the stock Jeep named jeep has finished loading:
jeep.setSteering(10);

jeep.steer

jeep.steer(angle)

Purpose: Equivalent steering method to jeep.setSteering(angle) on a loaded stock Jeep.

Arguments and limits: Finite angle in degrees; Unity clamps to -60..60. Use a function call. Do not assign jeep.steer = angle: that replaces this JavaScript function.

Result: undefined; no Promise or completion acknowledgment.

Effects: Sets the two front steering-joint rotation targets through the steer receiver. No transform teleport or freeze is performed by this method.

Completion: Fire-and-forget. Stock-object loading and joint initialization must already be complete; the receiver only yields once if called early.

Coordinates: Local steering-joint degrees, not a world heading. Zero requests straight wheels.

Requires: A loaded CS stock Jeep, not static GLB scenery; substitute its chosen actor name for jeep.

Save and cleanup: Live actor control. Reapply through the game's normal controls after loading; not stored in a movie-set manifest.

// After the Jeep has finished loading:
jeep.steer(0);

jeep.setSpeed

jeep.setSpeed(amount)

Purpose: Set the wheel-drive target on a loaded stock Jeep using its existing physics joints.

Arguments and limits: Supply a finite number. JavaScript parseFloat passes it to the receiver without an application-level clamp. No safe maximum is established by this contract. Start conservatively and test driving; do not assume amount is metres per second or a road-speed limit.

Result: undefined; no Promise or completion acknowledgment.

Effects: Sets targetAngularVelocity to (-amount,0,0) on all four wheel joints, and stores (int)amount as the speed command. The drive and physics determine actual movement. Zero requests zero target wheel rotation; it is not a guarantee of an immediate stop. Does not move the actor transform directly.

Completion: Fire-and-forget SendMessage. Wait for completed Jeep loading and joint setup; the receiver's early initialization check yields only once.

Coordinates: Wheel-joint angular-velocity target, not linear world velocity. Negative/positive values reverse that target; verify vehicle travel direction with the loaded prefab.

Requires: CS stock Jeep with four wheel joints available after jeepSetup. Naming an imported model jeep does not make it a controllable CS vehicle.

Save and cleanup: Live actor command, separate from the movie set. Initialize and update through normal game controls. Do not drive a physics vehicle by repeatedly writing its position on a timer.

// After the Jeep has finished loading:
jeep.setSpeed(5);

jeep.getSpeed

jeep.getSpeed()

Purpose: Request the Jeep's stored wheel-speed command. This does not measure its actual ground speed.

Arguments and limits: No arguments. The receiver returns the integer stored by setSpeed, not a Rigidbody velocity or measured wheel speed. Do not use this as evidence that the car is moving or as a physical speedometer.

Result: Immediately returns jeep.getSpeed.speed, the currently available callback value. It can be undefined before a reply and is not guaranteed fresh. There is no Promise to await.

Effects: Sends getSpeed to the actor. Unity's callback assigns the stored integer to jeep.getSpeed.speed.

Completion: The wrapper does not wait for a reply or correlate responses. Calling await jeep.getSpeed() does not add a completion protocol. Use documented actor-state velocity measurements if actual movement must be assessed, after retrieving that separate contract.

Coordinates: Stored integer wheel-drive command, with the same sign as the last setSpeed amount. Not metres per second.

Requires: Loaded stock Jeep using jeepSetup and the corresponding receiver callback.

Save and cleanup: A live cached reply, not durable scene data. May be absent when an actor is newly loaded.

// This requests the stored command; it is not measured driving speed.
var lastKnownWheelCommand = jeep.getSpeed();

createTerrain

createTerrain(name = "emptyterrain", width = 100, length = 100, height = 30)

Purpose: Create a separate, initially flat terrain with a collider.

Arguments and limits: Dimensions are metres in (0,4096]. Default origin is (0,0,0); X spans 0..width and Z spans 0..length. Height is the maximum vertical range, not the initial elevation. At most 8 terrains. The optional object form accepts position, resolution (33/65/129/257/513; default 129) and splatResolution (16/32/64/128/256; default 128). Name must be unique and at most 100 characters.

Result: Terrain reply with name, position, size, resolution, splatResolution and layerCount.

Effects: Creates one grey layer. Requires the terrain runtime and CSTerrainMaterial in the player.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await createTerrain("island", 200, 200, 40);

getTerrainInfo

getTerrainInfo(name)

Purpose: Read dimensions and texture layer count of an owned terrain.

Arguments and limits: Name must identify a terrain created by the terrain runtime.

Result: Terrain reply: position, size, resolution, splatResolution, layerCount and roads. Height/slope/normal in this general reply refer to the default sample coordinates; use sampleTerrainSurface for an intentional measurement.

Effects: Read only.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

var info = await getTerrainInfo("island");

exportTerrain

exportTerrain(name)

Purpose: Read a complete terrain data snapshot.

Arguments and limits: Flat heights are indexed z * resolution + x. Flat splats are indexed (z * splatResolution + x) * layerCount + layer. Heights are normalized 0..1.

Result: Terrain reply plus heights, splats, layers and roads. Layer texture URLs are references; image bytes are not embedded.

Effects: Read only. Save the snapshot through the movie-set pipeline; keep referenced assets available.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

var terrain = await exportTerrain("island");

sampleTerrainSurface

sampleTerrainSurface(name, x, z)

Purpose: Measure the terrain surface at a world position.

Arguments and limits: X and Z must lie inside the terrain bounds.

Result: Terrain reply containing world-space height, slope in degrees and surface normal.

Effects: Read only.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

var surface = await sampleTerrainSurface("island", 50, 50);

sampleTerrainHeight

sampleTerrainHeight(name, x, z)

Purpose: Read only the terrain surface height at a world position.

Arguments and limits: X and Z must lie inside terrain bounds.

Result: Number: world-space Y in metres.

Effects: Read only.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

var groundY = await sampleTerrainHeight("island", 50, 50);

listCSTerrains

listCSTerrains()

Purpose: List terrains owned by this runtime.

Arguments and limits: Does not list every arbitrary Unity Terrain in the original scene.

Result: Array of terrain name strings.

Effects: Read only.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

var names = await listCSTerrains();

removeTerrain

removeTerrain(name)

Purpose: Unload an owned terrain.

Arguments and limits: Name must exist. Does not delete files or automatically remove separately owned scenery and grass.

Result: Terrain completion reply.

Effects: Removes the terrain object, collider and owned terrain assets. Remove or re-place dependent scenery separately.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await removeTerrain("island");

paintTerrain

paintTerrain(name, x, z, radius = 10, layer = 0, amount = 1)

Purpose: Paint one texture layer with a circular falloff brush.

Arguments and limits: World-space X/Z and radius in metres; radius (0,4096]. Layer is zero-based and must exist. Amount is 0..1. At the centre, amount 1 fully selects that layer; edge strength fades smoothly.

Result: Terrain completion reply.

Effects: Changes splat weights, not geometry or object placement.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await paintTerrain("island", 50, 50, 12, 1, 0.8);

generateTerrain

generateTerrain(name, seed = 1, amplitude = 8)

Purpose: Replace the full terrain heightmap with seeded Perlin hills.

Arguments and limits: Amplitude is nonnegative metres. Optional object form accepts seed, amplitude, baseHeight (world Y), frequency (0,10], octaves 1..8. Default frequency .02, octaves 4, baseHeight 0. Results clamp to terrain vertical range.

Result: Terrain completion reply.

Effects: Replaces all existing sculpting. Existing objects do not follow the new heightmap.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await generateTerrain("island", 7, 12);

loadTerrainHeightmap

loadTerrainHeightmap(name, url)

Purpose: Replace heights from a PNG or JPEG image.

Arguments and limits: HTTP(S), browser-reachable and CORS-compatible. Images at most 4096 pixels per side. Uses normalized red-channel values and bilinear resampling to the terrain resolution. Relative URLs resolve against the game iframe.

Result: Terrain completion reply.

Effects: Replaces heights; does not re-ground scenery. No automatic grayscale luminance conversion.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await loadTerrainHeightmap("island", "/textures/island-height.png");

setTerrainHeights

setTerrainHeights(name, heights, options = {})

Purpose: Write a rectangular patch of normalized heights.

Arguments and limits: heights[z][x] is a nonempty rectangular array of finite values 0..1. options.xBase and options.zBase select sample indices, default 0. Patch must fit. World Y = terrain origin Y + normalized value * terrain height.

Result: Terrain completion reply.

Effects: Changes terrain geometry; separately placed objects stay where they were.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainHeights("island", [[0.1, 0.1], [0.1, 0.2]]);

raiseTerrain

raiseTerrain(name, x, z, radius = 10, amount = 1)

Purpose: Raise terrain using a circular falloff brush.

Arguments and limits: Amount is metres at the brush centre. X/Z must be inside terrain; radius (0,4096]. Heights clamp to the terrain vertical range.

Result: Terrain completion reply.

Effects: Changes geometry; does not re-ground objects.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await raiseTerrain("island", 60, 60, 15, 3);

lowerTerrain

lowerTerrain(name, x, z, radius = 10, amount = 1)

Purpose: Lower terrain using a circular falloff brush.

Arguments and limits: Positive amount lowers by that many metres at the centre; internally it is negated. Terrain cannot go below its origin Y.

Result: Terrain completion reply.

Effects: Changes geometry; does not re-ground objects.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await lowerTerrain("island", 60, 60, 15, 2);

flattenTerrain

flattenTerrain(name, x, z, radius = 10, height = 0)

Purpose: Blend a terrain patch toward a target world elevation.

Arguments and limits: Height is an absolute world-space Y, not normalized height. Radius is metres. Smooth brush falloff means the edge is not flattened as strongly as the centre.

Result: Terrain completion reply.

Effects: Changes geometry; does not re-ground objects.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await flattenTerrain("island", 50, 50, 12, 2);

smoothTerrain

smoothTerrain(name, x, z, radius = 10, strength = 0.5)

Purpose: Smooth a terrain patch toward neighbouring heights.

Arguments and limits: Strength 0..1, radius in metres. Uses a 3-by-3 sample average with circular falloff.

Result: Terrain completion reply.

Effects: Changes geometry; does not re-ground objects.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await smoothTerrain("island", 50, 50, 15, 0.5);

setTerrainColors

setTerrainColors(name, ...colors)

Purpose: Replace all terrain layers with solid colours.

Arguments and limits: 1..4 valid HTML colours; colours may also be supplied as an array.

Result: Terrain completion reply.

Effects: Resets all splat weights to layer 0. Existing painted texture distribution is lost.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainColors("island", "#b9a477", "#617347", "#75746d");

setTerrainTextures

setTerrainTextures(name, ...urls)

Purpose: Replace all terrain layers with image textures.

Arguments and limits: 1..4 HTTP(S) image URLs, each at most 4096 pixels per side, browser-readable with CORS. Relative paths resolve in the iframe. Default tile size 10 metres.

Result: Terrain completion reply.

Effects: Resets painting to layer 0. Use setTerrainTexture to replace one layer while preserving painting.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainTextures("island", "/textures/sand.jpg", "/textures/grass.jpg");

setTerrainLayers

setTerrainLayers(name, layers)

Purpose: Replace all terrain layers with full material settings.

Arguments and limits: 1..4 objects: url or color; optional normalUrl, tileSize > 0 (default 10m), normalScale 0..4 (default 1), smoothness 0..1, metallic 0..1. Texture and normal image dimensions <=4096. Browser URL/CORS rules apply.

Result: Terrain completion reply.

Effects: Resets all painting to layer 0. Downloads stage before layer replacement.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainLayers("island", [{url: "/textures/sand.jpg", tileSize: 6}]);

setTerrainTexture

setTerrainTexture(name, layer, url, normalUrl, tileSize)

Purpose: Replace a single existing layer texture and preserve the painted distribution.

Arguments and limits: Layer index starts at 0. Omitted normalUrl and tileSize preserve existing settings; empty normalUrl removes the normal map. Serially await edits to the same terrain.

Result: Terrain completion reply from restored splat weights.

Effects: Exports layers/splats, replaces layers, restores splats. Attempts rollback on splat failure; rollback failure is explicitly reported. It is not a database transaction.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainTexture("island", 0, "/textures/new-sand.jpg");

setTerrainSplatmap

setTerrainSplatmap(name, options)

Purpose: Replace the full terrain texture-weight map.

Arguments and limits: options contains columns, rows, layerCount, values. Dimensions must equal splatResolution. values[(z * columns + x) * layerCount + layer] must be finite and nonnegative. Each pixel needs positive total weight; Unity normalizes it.

Result: Terrain completion reply.

Effects: Replaces all texture painting. It does not alter heights.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await setTerrainSplatmap("island", savedSplatmap);

placeOnTerrain

placeOnTerrain(name, objectName, x, z, offset = 0)

Purpose: Place an already loaded object's pivot on terrain once.

Arguments and limits: Offset is metres above the sampled terrain. This uses the object's pivot, not renderer bottom; choose clearance for physics actors. Object must exist and cannot itself be terrain.

Result: Terrain reply containing objectName and objectPosition.

Effects: One-time placement through Rigidbody.position where present. Does not parent, freeze, continuously follow, or clear velocity. The JS shared-memory position mirror is updated on reply.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSTerrainRuntime and prepared terrain resources. Existing terrain required except for create/list.

Save and cleanup: Terrain data is included by exportMovieSet/saveMovieSet. Textures remain URL references. Remove with removeTerrain or unload the movie set.

await placeOnTerrain("island", "jeep", 50, 50, 2);

setSunLight

setSunLight(color = "#fff0d4", intensity = 1.3, pitch = 42, yaw = -35)

Purpose: Set the scene's directional sunlight.

Arguments and limits: HTML colour, intensity 0..10, pitch/yaw in degrees. Uses the existing sun when available, otherwise creates one.

Result: Updated lighting settings object.

Effects: Preserves other recorded lighting fields; applies flat ambient mode together with the stored ambient settings.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await setSunLight("#fff0d4", 1.3, 42, -35);

setAmbientLight

setAmbientLight(color = "#9dabc0", intensity = 0.7)

Purpose: Set flat ambient fill lighting.

Arguments and limits: HTML colour and multiplier 0..5.

Result: Updated lighting settings object.

Effects: Ambient mode becomes Flat; colour is multiplied by intensity. Does not create local lights.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await setAmbientLight("#b8c5d4", 0.9);

setSunShadows

setSunShadows(enabled = true, strength = 0.85)

Purpose: Enable or disable sun shadows and set their strength.

Arguments and limits: enabled must be boolean; strength 0..1. Actual shadow appearance also depends on the included URP renderer configuration.

Result: Updated lighting settings object.

Effects: Changes directional light shadows, not point-light shadows.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await setSunShadows(true, 0.8);

getSceneLighting

getSceneLighting()

Purpose: Read stored lighting, point lights, probes and post-processing.

Arguments and limits: configured indicates whether the environment runtime has explicit lighting settings; defaults are not proof the scene was configured.

Result: Object: configured, lighting, lights, reflections, postProcessing.

Effects: Read only.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

var lighting = await getSceneLighting();

createLight

createLight(name, x = 0, y = 3, z = 0, color = "#ffffff", intensity = 3, range = 10)

Purpose: Create or replace an environment point light.

Arguments and limits: World metres; intensity 0..100, range .1..1000. At most 8 point lights and 48 environment objects. Unique name outside environment-owned objects, <=100 characters, no slash.

Result: Stored point-light settings.

Effects: Point lights do not cast shadows. Reusing an environment-owned name replaces that object.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await createLight("lamp", 10, 3, 8, "#ffd293", 3, 10);

removeLight

removeLight(name)

Purpose: Remove an environment point light.

Arguments and limits: Checks that the named object is a recorded point light.

Result: Object with removed: name.

Effects: Unloads the point light.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await removeLight("lamp");

createReflectionProbe

createReflectionProbe(name, x = 0, y = 5, z = 0, width = 20, height = 10, length = 20)

Purpose: Create or replace a local environment reflection probe.

Arguments and limits: World metres. Each dimension >.1 and <=2048. At most 4 probes. Wrapper uses resolution 128, intensity 1 and box projection.

Result: Stored reflection settings.

Effects: Captures on creation, with time-sliced faces; completion does not prove all faces are already rendered. Excludes Water layer. Recreate to capture changed scenery. Materials must support probes.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await createReflectionProbe("courtyard", 20, 5, 20, 30, 12, 30);

removeReflectionProbe

removeReflectionProbe(name)

Purpose: Remove a named environment object, intended for a reflection probe.

Arguments and limits: Unlike removeLight, this wrapper does not check the object type. Pass a known probe name.

Result: Object with removed: name.

Effects: Can remove another environment object if given its name; do not guess names.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await removeReflectionProbe("courtyard");

setPostProcessing

setPostProcessing(exposure = 0, contrast = 0, saturation = 0, bloom = 0.1, vignette = 0.1)

Purpose: Set global camera colour and lens effects.

Arguments and limits: Exposure -10..10 stops, contrast/saturation -100..100, bloom 0..10, vignette 0..1. URP post-processing support must be included in the build.

Result: Stored post-processing settings.

Effects: Enables a global priority-100 volume with ACES tonemapping; bloom threshold 1.1. Replaces this runtime's previous post-processing profile.

Completion: Returns a Promise. Await completion before dependent commands. A transport timeout means the outcome is unknown; read current state before retrying.

Coordinates: Unity world metres, Y up; rotations in degrees unless stated otherwise.

Requires: Unity player with CSEnvironmentRuntime; verify environment capabilities before using a newly deployed command.

Save and cleanup: Environment settings are included in movie-set export/restore. Runtime-created lights/probes unload with the set. Resetting environment settings can also affect camera controls and other environment settings.

await setPostProcessing(0.3, 5, -5, 0.1, 0.1);

createCar

await createCar(config)

Purpose: Create a reusable, version-pinned four-wheel car instance using the existing GLB physics and configurable-joint engine.

Arguments and limits: Explicit prototype jointed-car@1; unique identifier name up to24 characters; body/chassis/carrier GLB descriptors and four wheel descriptors with car-local base offsets, steering/driven flags. See guide:car-prototypes for schema, defaults and methods. Sphere wheels; chassis collision must clear wheels. Requires compatible geometry; no automatic asset decomposition. Other versions are rejected.

Result: Promise of independent instance: name, prototype, parts, setControls, setSuspension, getState, getConfig, reset, dispose. The team relay returns serializable state instead.

Effects: Loads ten models, configures bodies, creates eight suspension/wheel joints and one shell joint, then starts a serialized update loop. Each instance has unique names and isolated controls. No camera, lighting, key bindings or UI changes. On import failure cleans only its own partial assembly.

Completion: Await createCar before dependent work. reset, setSuspension and dispose return Promises. setControls and getState are synchronous. Creation cancellation and editor clear await cleanup before reload.

Coordinates: Configuration offsets in car-local metres: +Z forward, +Y up, +X right. Position translates the entire assembly and heading rotates it about Y. Wheel offsets locate base origins; pivots use wheel radius and carrier hubHeight.

Requires: Scene primitiveColliders and rigidbody capabilities; shared prototype capability jointed-car@1. Joint receiver jcreateJoint/jchangeJoint2 already deployed. Student project uses only public CS APIs, no imports.

Save and cleanup: Keep explicit prototype version and config in the single saved main script. Script replay reconstructs behavior and joints; movie-set snapshots alone do not restore controllers. Reset retains current shock values. Incompatible future prototypes must receive new version IDs; this release does not bundle private prototype source per publication.

var car = await createCar(carConfig);
car.setControls({throttle:1, steering:0, brake:false});
await car.setSuspension({spring:0, damping:0});

Physics platformer and simple machines

Requires platformerToolsV1. These asynchronous commands use ordinary Rigidbody physics and the existing MainCamera. Refresh the Game view after the player is updated.

load("westerncowboy", "cowboy", 0, 2, 0);
// Wait for the object to finish loading before enabling the controller.
await platformerCharacter("cowboy", true, {
  takeControl:true, unityGravity:true, height:1.8, radius:0.3, footOffset:0.07,
  clips:{idle:"H_Idle2", run:"S_Walk_F", jump:"Jump_InPlace", fall:"H_Fall_Low2", climb:"H_Free_Climb_North", swing:"H_Idle2"}
});
await cameraMode("side", "cowboy", {distance:10, height:1});

The westerncowboy bundle is a separate CS-ready version of the cowboy; inspect other models' actual clips. The single dynamic root, upright capsule and root Animator are required. Dancer/articulated models are not supported by this controller. Use takeControl:true only for an intentional reversible native-controller handoff. Arrow keys or WASD move and climb, Space jumps or releases, Shift runs. The motor temporarily disables JS-to-Unity position writes and restores the previous setting when disabled. keyboard:false lets characterInput drive an NPC or custom controls. Movement is physics-driven; it inherits moving-support momentum. Disable with await platformerCharacter(name, false).

await platformerAttach("cowboy", "ropeEnd", "swing", {reach:1.5, visualGrip:true});
await platformerRelease("cowboy");
await platformerAttach("cowboy", "ladderAnchor", "climb", {reach:1.5, climbSpeed:2});
await getPlatformerState("cowboy");
await getPlatformerCharacter("cowboy");

Anchor must be a Rigidbody in the same physics scene, within reach. Swing/climb attach physically; release preserves motion. Optional visual hand grip needs a compatible humanoid rig. Climb animation and the actual ladder geometry must be checked visually. The swing clip in the cowboy example is an idle placeholder.

physicsRaycastImpulse(origin, direction, impulse = 4, distance = 1000, settings = {}): the third argument is impulse magnitude; the fourth is maximum ray distance. In the example below, 8 is the impulse and 20 is the distance.

await platformerUpperBody("cowboy", "H_Gun Aim E", "Rotator/Offset/root/pelvis/spine_01");
await platformerUpperBody("cowboy", false);
var hit = await physicsRaycastImpulse({x:0,y:2,z:0}, {x:1,y:0,z:0}, 8, 20, {ignore:["cowboy"]});
await coupleGears("smallGear", "largeGear", {axis:{x:0,y:0,z:1}, radiusA:0.5, radiusB:1, maxTorque:1000});
await getGearState("smallGear");
await releaseGears("smallGear");

The aim layer poses the upper body; it does not create or fit a gun. Raycast impulse strikes an actual dynamic body at the hit point; it does not create a bullet, ammunition, sound or damage rules. Gears couple two dynamic parallel-axis external shafts with angular impulses, not simulated teeth; use real pivots and distinct gear bodies. Existing pulley demos retain their separate physics-scene limits.

characterController

await characterController(name, enabled=true, settings={})

Purpose: Enable/disable a dynamic actor capsule motor; preserves mass/gravity, restores previous collider/constraint ownership when disabled. Options walkSpeed/runSpeed/jumpHeight/acceleration/slopeLimit/stepHeight/height/radius/keyboard. WASD+Shift+Space; no interpolation.

Arguments and limits: Enable/disable a dynamic actor capsule motor; preserves mass/gravity, restores previous collider/constraint ownership when disabled. Options walkSpeed/runSpeed/jumpHeight/acceleration/slopeLimit/stepHeight/height/radius/keyboard. WASD+Shift+Space; no interpolation. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

getCharacterState

await getCharacterState(name)

Purpose: Read actual enabled/grounded/position/velocity and motor settings.

Arguments and limits: Read actual enabled/grounded/position/velocity and motor settings. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

characterInput

await characterInput(name, sideways, forward, jump=false, run=false)

Purpose: Set motor input axes -1..1 and one jump request; use keyboard:false with custom bindings; send zero on release.

Arguments and limits: Set motor input axes -1..1 and one jump request; use keyboard:false with custom bindings; send zero on release. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

cameraMode

await cameraMode(mode, character, settings={})

Purpose: Switch existing MainCamera: firstPerson, thirdPerson, orbit, fixed. Optional height/distance/yaw/pitch/sensitivity/mouse/followHeading. Click Game for mouse, Escape releases. Existing camera commands release this owner.

Arguments and limits: Switch existing MainCamera: firstPerson, thirdPerson, orbit, fixed. Optional height/distance/yaw/pitch/sensitivity/mouse/followHeading. Click Game for mouse, Escape releases. Existing camera commands release this owner. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

getCameraMode

await getCameraMode()

Purpose: Read active character camera mode, target and actual pose. Does not create a camera.

Arguments and limits: Read active character camera mode, target and actual pose. Does not create a camera. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

getCharacterRig

await getCharacterRig(name)

Purpose: List full transform paths and positions, discovered rightHand/leftHand/head; missing aliases return null, ambiguous selections require explicit path.

Arguments and limits: List full transform paths and positions, discovered rightHand/leftHand/head; missing aliases return null, ambiguous selections require explicit path. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

wieldWeapon

await wieldWeapon(character, weapon, hand="rightHand", grip="hand", axis="z")

Purpose: Attach a single prop to a bone. Grip hand/alongForearm/acrossForearm; axis x/-x/y/-y/z/-z. Suspends prop collisions/physics/shared-memory writes; does not alter character mass. Reject articulated weapons.

Arguments and limits: Attach a single prop to a bone. Grip hand/alongForearm/acrossForearm; axis x/-x/y/-y/z/-z. Suspends prop collisions/physics/shared-memory writes; does not alter character mass. Reject articulated weapons. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

weaponGrip

await weaponGrip(weapon, grip, axis="z")

Purpose: Change held prop orientation preset and weapon length axis. Preset aligns at configuration time then follows the hand.

Arguments and limits: Change held prop orientation preset and weapon length axis. Preset aligns at configuration time then follows the hand. See guide:character-tools for full parameters and limits. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

weaponOffset

await weaponOffset(weapon, x, y, z)

Purpose: Set hand-local grip offset; does not change weapon handle coordinates.

Arguments and limits: Set hand-local grip offset; does not change weapon handle coordinates. See guide:character-tools for full parameters and limits. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

weaponRotation

await weaponRotation(weapon, x, y, z)

Purpose: Set additional local Euler rotation in degrees after the grip preset.

Arguments and limits: Set additional local Euler rotation in degrees after the grip preset. See guide:character-tools for full parameters and limits. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

weaponGripPoint

await weaponGripPoint(weapon, x, y, z)

Purpose: Set the handle point in weapon local coordinates; this point meets hand plus offset instead of forcing model origin into hand.

Arguments and limits: Set the handle point in weapon local coordinates; this point meets hand plus offset instead of forcing model origin into hand. See guide:character-tools for full parameters and limits. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop. Disable weaponIK before changing grip calibration; moveWeapon/rotateWeapon move the arm with the held prop.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

releaseWeapon

await releaseWeapon(weapon)

Purpose: Detach held prop at its current pose; restore original parent/collision/body/CS ownership and inherit character linear velocity.

Arguments and limits: Detach held prop at its current pose; restore original parent/collision/body/CS ownership and inherit character linear velocity. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

await wieldWeapon("soldier", "rifle", "rightHand", "alongForearm", "z");

physicsRaycast

await physicsRaycast(origin, direction, distance=1000, settings={})

Purpose: Nearest collider hit/miss; optional ignore names, layerMask and triggers. Distance .001..10000 metres; nonzero direction.

Arguments and limits: Nearest collider hit/miss; optional ignore names, layerMask and triggers. Distance .001..10000 metres; nonzero direction. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

meshRaycast

await meshRaycast(origin, direction, distance=1000, settings={})

Purpose: Nearest visible triangle hit without collider creation; current skinned pose. Optional targets/ignore/layerMask. CPU-readable mesh required; max250000 candidate triangles.

Arguments and limits: Nearest visible triangle hit without collider creation; current skinned pose. Optional targets/ignore/layerMask. CPU-readable mesh required; max250000 candidate triangles. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

cameraRaycast

await cameraRaycast(distance=1000, kind="physics", ignore=[])

Purpose: Cast from MainCamera centre in physics or mesh mode; ignore shooter object to avoid self-hits.

Arguments and limits: Cast from MainCamera centre in physics or mesh mode; ignore shooter object to avoid self-hits. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

effectAt

await effectAt(type, x, y, z, seconds=3, scale=1)

Purpose: Spawn an existing installed ParticleSystem prefab at a point; seconds .1..120, scale .001..100, max64 effects. No new asset/shader download.

Arguments and limits: Spawn an existing installed ParticleSystem prefab at a point; seconds .1..120, scale .001..100, max64 effects. No new asset/shader download. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

crossFadeModelAnimation

await crossFadeModelAnimation(name, clip, seconds=0.2, speed=1, loop=true)

Purpose: Crossfade current base to exact discovered clip over0..10s; existing legacy/GLB/Animator player, speed -10..10, no root motion.

Arguments and limits: Crossfade current base to exact discovered clip over0..10s; existing legacy/GLB/Animator player, speed -10..10, no root motion. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

layerModelAnimation

await layerModelAnimation(name, clip, bone, weight=1, speed=1, loop=true)

Purpose: One masked branch clip over a playing base. Exact path/unique bone; weight0..1, different clip from base/outgoing fade. No invented clips, retargeting or two-handed IK.

Arguments and limits: One masked branch clip over a playing base. Exact path/unique bone; weight0..1, different clip from base/outgoing fade. No invented clips, retargeting or two-handed IK. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

clearModelAnimationLayer

await clearModelAnimationLayer(name)

Purpose: Remove masked upper layer; base playback remains.

Arguments and limits: Remove masked upper layer; base playback remains. See guide:character-tools for full parameters and limits.

Result: Readback object; raycasts include hit, name, part, point, normal, distance, triangle and dynamic on hit.

Effects: Per description; no game-specific code or new cameras. Held props temporarily stop independent physics; characters retain mass/gravity.

Completion: Returns a Promise; await before dependent commands.

Coordinates: Unity world metres, degrees, Y up; legacy actor.pos X is mirrored. Weapon offsets hand-local, gripPoint weapon-local, rotation local Euler.

Requires: Matching script.js and WebGL characterToolsV1; loaded uniquely named objects. Motor needs upright single dynamic actor; rig attachment needs a real hand/path.

Save and cleanup: Keep motor, input and weapon setup in saved game script. clearRun tears down runtime tools. Imported animation base/layer state persists in movie sets; active fade restores destination.

See guide:character-tools for readable setup and inspection examples.

getSceneParts

getSceneParts(name)

Purpose: Inspect every imported GLB node and its current collider/body.

Arguments and limits: Read-only. Use nodeId for subsequent part operations; duplicate display paths are ambiguous.

Result: Promise of part records including nodeId, original path, physicsName, local/world pose and bounds, body and actual colliderShapes.

Effects: Read-only. Use nodeId for subsequent part operations; duplicate display paths are ambiguous.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

var parts = await getSceneParts("car");

getModelPart

getModelPart(name, part)

Purpose: Inspect one imported GLB part by stable nodeId or unambiguous path.

Arguments and limits: Read-only; no CS actor registration is implied.

Result: Promise of one live part record.

Effects: Read-only; no CS actor registration is implied.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

var wheel = await getModelPart("car", parts[0].nodeId);

setSceneCollider

setSceneCollider(name, collider)

Purpose: Replace collision on an imported model using fitted or explicit primitives, meshes or mixed compound shapes.

Arguments and limits: Supported types: none, box, sphere, capsule, mesh, convex and compound. Object recipes may specify center, size, radius, height, capsule direction, part paths, trigger, material. Dimensions are collider-local. Invalid replacement preserves old active colliders; dynamic bodies reject concave mesh or trigger-only collision. Remove per-part profiles before setting whole-model colliders. Promoted CS actors retain their existing root-box profile.

Result: Promise of the scene reply, with item containing actual colliderShapes and stored colliderConfig.

Effects: Supported types: none, box, sphere, capsule, mesh, convex and compound. Object recipes may specify center, size, radius, height, capsule direction, part paths, trigger, material. Dimensions are collider-local. Invalid replacement preserves old active colliders; dynamic bodies reject concave mesh or trigger-only collision. Remove per-part profiles before setting whole-model colliders. Promoted CS actors retain their existing root-box profile.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

await setSceneCollider("rock", {type:"sphere", radius:1});

setSceneRigidbody

setSceneRigidbody(name, body)

Purpose: Configure a whole imported model as static, kinematic or dynamic scenery physics.

Arguments and limits: Mode none removes Rigidbody, preserving static collision; kinematic or dynamic add/configure one. Body settings are complete, not partial patches. Dynamic requires solid primitive/convex/compound collision. Remove independent part bodies and transform-motion controllers before adding a root Rigidbody. Existing actor promotion remains separate.

Result: Promise of updated scene item.

Effects: Mode none removes Rigidbody, preserving static collision; kinematic or dynamic add/configure one. Body settings are complete, not partial patches. Dynamic requires solid primitive/convex/compound collision. Remove independent part bodies and transform-motion controllers before adding a root Rigidbody. Existing actor promotion remains separate.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

await setSceneRigidbody("rock", {mode:"dynamic", mass:25, useGravity:true});

setModelPartCollider

setModelPartCollider(name, part, collider)

Purpose: Replace the collider profile of one inspected GLB part.

Arguments and limits: Model root collider must be none. Uses the same shape and material settings as setSceneCollider, in selected-node local units. Collider regions may not overlap configured ancestors/descendants. Primitive fitting requires renderer bounds. Colliders attach to the part; physics mode is set separately.

Result: Promise of updated part state including actual shapes.

Effects: Model root collider must be none. Uses the same shape and material settings as setSceneCollider, in selected-node local units. Collider regions may not overlap configured ancestors/descendants. Primitive fitting requires renderer bounds. Colliders attach to the part; physics mode is set separately.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

await setModelPartCollider("car", wheelNodeId, {type:"sphere", radius:0.33});

setModelPartRigidbody

setModelPartRigidbody(name, part, body, physicsName)

Purpose: Give an inspected GLB part independent static, kinematic or dynamic physics and an optional unique name for joints.

Arguments and limits: Root must have no collider or Rigidbody and no active motion/animation/hinge controllers. Parts with nested independent bodies are rejected. Set the part collider first. physicsName is a globally unique simple identifier; omission generates a unique name. Use the returned name with createJoint. Root transform and animation are guarded while part bodies exist.

Result: Promise of updated part state with actual physicsName and body.

Effects: Root must have no collider or Rigidbody and no active motion/animation/hinge controllers. Parts with nested independent bodies are rejected. Set the part collider first. physicsName is a globally unique simple identifier; omission generates a unique name. Use the returned name with createJoint. Root transform and animation are guarded while part bodies exist.

Completion: Await the Promise before dependent commands. Scene transport timeout leaves outcome unknown; inspect the scene before retrying mutations.

Coordinates: Unity world metres/Y up for world poses and Rigidbody velocities. Collider dimensions and centers are in selected-node local units. Node IDs are stable within a saved GLB hierarchy.

Requires: Player capabilities primitiveColliders/compoundColliders/partPhysics as applicable. Inspect getSceneParts before selecting a node. Imported GLB scenery only.

Save and cleanup: Collider recipes and independent part bodies/names/poses are included in getSceneState and movie-set export/restore. Joint definitions remain rerunnable game-script responsibility.

var wheel = await setModelPartRigidbody("car", wheelNodeId, {mode:"dynamic", mass:25, useGravity:true}, "wheelFL");

getModelAnimations

getModelAnimations(name)

Purpose: List sorted, exact clip names from a loaded GLB, Unity Animation, or Unity Animator. Empty list means no clips.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await getModelAnimations("fox");

getModelAnimationState

getModelAnimationState(name)

Purpose: Read backend, clips, selected clip, status, time, duration, speed and loop. Controller state names are not clip names.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await getModelAnimationState("fox");

playModelAnimation

playModelAnimation(name, clip, speed = 1, loop = true)

Purpose: Play an exact discovered clip from its beginning; negative speed starts at the end. loop=false plays once and holds the final pose; true repeats.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await playModelAnimation("fox", "Walk", 1, true);

pauseModelAnimation

pauseModelAnimation(name)

Purpose: Pause at the current pose and playhead.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await pauseModelAnimation("fox");

resumeModelAnimation

resumeModelAnimation(name)

Purpose: Resume without resetting the playhead. A finished once clip stays finished at its boundary; use restart to replay.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await resumeModelAnimation("fox");

stopModelAnimation

stopModelAnimation(name)

Purpose: Rewind to time zero, hold the initial pose and report stopped.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await stopModelAnimation("fox");

restartModelAnimation

restartModelAnimation(name)

Purpose: Restart the selected clip with the current speed and loop setting; negative speed restarts at the end.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await restartModelAnimation("fox");

setModelAnimationSpeed

setModelAnimationSpeed(name, speed)

Purpose: Change speed without resetting or resuming playback. 1 is normal, 0 freezes playhead, negative runs backwards.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await setModelAnimationSpeed("fox", 0.5);

showAnimationExplorer

showAnimationExplorer(name)

Purpose: Open the reusable responsive animation explorer in the standard control panel for an existing model. Lists clips, offers once/loop, pause/resume, stop/restart and speed. Does not load, move or automatically play the model.

Arguments and limits: name identifies one loaded scene instance or uniquely named stock model. Use exact clip names from getModelAnimations; names are case sensitive. Speed must be finite in [-10,10]; loop is boolean. Pause/resume/stop/restart/speed require a previously selected clip. Models with multiple animation players or ambiguous duplicate clip names require a unique child target. A zero-duration pose finishes immediately.

Result: Promise resolving to sorted string[] for getModelAnimations; otherwise a playback snapshot {backend,clips,clip,status,time,duration,speed,loop}. showAnimationExplorer instead resolves to the UI name after mounting.

Effects: Automatically selects glb, unity-legacy or unity-animator. Animates existing visual clips, never adds physics behavior. Legacy animation on a Rigidbody transform and animated child Rigidbody rigs are rejected. Animator root motion is disabled during managed playback. No Rigidbody mass, constraints, interpolation or velocity is changed. Stock controller-driven animations are unchanged until explicit managed playback takes control.

Completion: Await the reply from the Unity jSceneCommand receiver. Readback is not a visual gameplay test.

Coordinates: Clip time/duration are seconds; speed is a multiplier. Animation affects imported visual bones/meshes; move the actor with CS physics commands, not repeated transforms.

Requires: Requires both updated script.js and a Unity build advertising modelAnimation/modelAnimations. The explorer additionally needs the matching cs-ui.js. Model must contain imported clips or a Unity Animation/Animator controller with clips. No invented animations or state names.

Save and cleanup: Movie-set state preserves managed clip, loop, speed, playhead and status for imported scene models, restored after CS actor registration. Stock objects remain owned by rerunnable game code. Removing the object destroys its player. clearRun/unloadUI clears the explorer; it uses the standard UI lifecycle. Explorer replaces the current control-panel UI, so integrate the same controls into an existing game panel when needed.

await showAnimationExplorer("fox");

loadGLB

loadGLB(url, name, options = {})

Purpose: Download and instantiate a prepared binary GLB as measured scenery. This does not by itself create a named CS physics actor.

Arguments and limits: url resolves against the Game frame document URL and must use HTTP(S); HTTPS pages also require browser mixed-content and CORS rules. GLB v2 must be 20 bytes..32 MiB with embedded buffers and PNG/JPEG images. The required-extension allowlist is KHR_materials_unlit and KHR_texture_transform; normalize other required extensions before import. Name is unique, 1..100 characters with no slash; choose a free JavaScript identifier if promotion is intended. Prototype limits: 32 distinct GLB URLs and 256 instances. Options: position/rotation finite {x,y,z}; scale per-axis (0,100]; height (0,1000], default 6; collider auto/none/box/sphere/capsule/mesh/convex/compound, default auto; kind defaults scenery, building makes auto choose mesh, otherwise none. Collider may also be a settings object with dimensions, per-shape material and compound shapes; see guide:glb-part-physics.

Result: Promise of getSceneObject-style state, including name, url, position, rotation, scale, collider, height, boundsCenter, boundsSize and body. It is not a CSObject; no global actor is registered by import alone. Includes colliderConfig, actual colliderShapes and configured partPhysics.

Effects: Instantiates the main GLB scene, normalizes its unrotated height, centers geometry horizontally and seats the base at the import root before applying rotation, position and scale. Reuses importer data for the same URL and retains reference counts. Imported animation clips use the existing scene animation API; they do not become named CS joints. Imported clips now start stopped. Use getModelAnimations and the unified model animation commands; a named zero-duration pose is not moving animation.

Completion: Await import before measurements or makeCSObject. The scene transport waits up to 180 seconds; a timeout leaves outcome unknown, so inspect scene state before retrying a name. Download timeout is 60 seconds. Failure before commit disposes the new importer/root.

Coordinates: Unity world metres, Y up; position is the root pivot initially at the centered model base. Rotation is world Euler degrees; root scale is dimensionless. This has no legacy CS actor X sign conversion.

Requires: Player with loadGLB scene capability, supported glTF importer/shaders and browser access to the prepared file. The relay alias is loadModel(url,name,options); use loadGLB in editor scripts. Sketchfab page URLs, model IDs, ZIPs and files local to the RunPod are not importable URLs.

Save and cleanup: Movie-set export records the source URL and scene state, not the model bytes. Keep the GLB hosted at a durable URL. removeSceneObject or movie-set unload removes the instance, and final reference removal disposes importer resources. runGameScript/clearRun replaces scenery, so rerunnable game source must include required imports. Imported independent part colliders, bodies, aliases and current local poses are serialized; joints must still be rebuilt by the game script.

async function prepareProp() {
    await loadGLB("/models/prepared-crate.glb", "crate", {position:{x:0,y:3,z:0}, height:1, collider:"none"});
}
var gameReady = prepareProp();

makeCSObject

makeCSObject(name, collider = "box")

Purpose: Promote an already imported GLB instance into a generic CS physics actor without changing its visible geometry, materials or world pose.

Arguments and limits: Name must identify an imported scene root and be a free JavaScript identifier (1..100 characters). Reserved names and existing JS globals are rejected. Only box collider is accepted by the public wrapper. Stop imported animation, paths, motion and hinges first; articulated child Rigidbodies and an unregistered existing physics component are rejected. Requires capacity in the shared-memory actor array. Repeating for the same already-registered actor returns that actor rather than duplicating it.

Result: Promise resolving to the actual named CSObject, also installed under its global name and present in the normal objects array. The relay adapter instead returns a plain actor/scene receipt suitable for JSON.

Effects: Prepares a root box collider, Rigidbody, physics component, lifetime cleanup and default friction material; registers Unity and JavaScript atomically with 24 shared floats per actor. Existing root mass, damping, gravity and constraints are retained; a bodyless prop gets a dynamic 1 kg body with built-in gravity, zero linear/angular damping and no frozen constraints. Interpolation is always off, matching the stock box prefab; it is not an authoring option. Dynamic bodies use ContinuousDynamic collision detection, kinematic bodies Discrete. Default actor.acc is zero additional acceleration, not gravity. No vehicle wheels/steering, character behavior, animation rig or downloaded C# scripts are inferred. Required registration/component failures roll back. Scenery transform/body/path/legacy scene-animation controllers are blocked after promotion. Unified model animation commands may animate child visuals, keeping the CS body root under physics control. Use documented actor APIs for movement.

Completion: Await the operation before using name.vel, name.pos, name.acc or mass. Completion requires both registry sides to agree. A transport timeout has uncertain outcome; inspect scene/actor state before retrying. Successful registration does not prove observed physics/gameplay.

Coordinates: Visible pose is preserved. Legacy CS pos/vel/acc/angvel use negative Unity X while Y and Z agree. Scene transform/bounds and persisted body/descriptor vectors remain Unity values. Do not assign scene position directly into actor.pos without converting X. Positions are metres and velocities metres/second.

Requires: Await loadGLB(url,name,options) in editor code or loadModel in the relay first. Both the makeCSObject wrapper and Unity makeCSObject capability must be present. Existing stock actors still use load(type,name), never load("glb",name). Use initial placement or deliberate resets; do not continuously overwrite physics position using timers or transform-follow recipes.

Save and cleanup: Scene state adds csObject:true and actor:{version:1,type:"glb",acceleration:{x,y,z}} plus body and import transform. Restore imports first, then restores registration/body/acceleration. Game functions and input bindings remain in game source. removeSceneObject/relay removeModel unregister both actor lists and compact memory before destroying the instance; unload/clearRun also clean up. The hosted GLB remains.

async function prepareProp() {
    await loadGLB("/models/prepared-crate.glb", "crate", {position:{x:0,y:3,z:0}, height:1, collider:"none"});
    await makeCSObject("crate");
    crate.vel.x = 3;
    crate.vel.y = 5;
}
var gameReady = prepareProp();

measureModel

measureModel(name)

Purpose: Measure imported scenery in metres, including its world bounding-box bottom and top.

Arguments and limits: Name identifies scenery, not a stock CS actor. Uses combined world-axis-aligned renderer bounds, including children. These are not mesh dimensions in local axes or interior/collider clearances.

Result: Promise resolving to name, units, width, height, depth, center, min, max, bottom, top, position, rotation, scale and boundsType. Min/max are vectors; width/height/depth correspond to world X/Y/Z extents.

Effects: Read only. Rotating a model changes world box width/depth even when local scale is unchanged.

Completion: Await the result before using dimensions.

Coordinates: Unity world metres, Y up. No legacy actor X mirroring.

Requires: Existing scenery with renderer bounds and getSceneObject support in the player. A GLB promoted with makeCSObject remains measurable through the scene registry; returned geometry uses Unity coordinates, not mirrored CS actor X.

Save and cleanup: Computes measurements on request; does not save or alter the object.

var boatSize = await measureModel("rowboat");
console.log(boatSize.width, boatSize.height, boatSize.bottom);

setModelHeight

setModelHeight(name, height)

Purpose: Uniformly resize scenery so its current world bounding-box height matches a requested height.

Arguments and limits: Height must be a finite positive number; current measured height must be positive. Multiplies each existing root scale component by height/currentHeight. The resulting scale must satisfy Unity's per-axis (0,100] limit. Existing proportions, including any nonuniform scale, are retained. Whole-model transform changes are rejected while independent part rigidbodies exist.

Result: Promise resolving to the new measureModel result.

Effects: Changes root localScale then reads dimensions again. It does not reposition the root or re-ground the object. Rotated or animated geometry uses its current world box, not a semantic upright height. Inspect support after resizing.

Completion: Queued with moveModel in the model helper queue. Await before dependent placement; a timeout has an uncertain outcome.

Coordinates: Requested world vertical extent in metres; scale is dimensionless.

Requires: Registered scenery with measurable renderer height and scene transform capability. Not a CS actor scaling method. This scenery transform operation rejects objects already promoted with makeCSObject. Use documented actor position/rotation/scale for intentional placement/reset after promotion, and physics for ongoing motion.

Save and cleanup: Current root scale is captured in subsequent scenery/movie-set exports. Saving still requires the normal save operation.

await setModelHeight("cabin", 4);
await groundModel("cabin", "island", 40, 50);

moveModel

moveModel(name, x, y, z)

Purpose: Place a scenery root at an absolute world position once.

Arguments and limits: All three coordinates must be finite numbers. Uses the scenery registry; this does not move a stock CS actor or automatically find the terrain surface. Whole-model transform changes are rejected while independent part rigidbodies exist.

Result: Promise resolving to the updated measureModel result.

Effects: Sets root position and synchronizes physics transforms. Keeps rotation and scale. This is an authoring placement operation, not a force, vehicle controller or safe per-frame way to drive a dynamic body.

Completion: Queued with setModelHeight; await completion before dependent measurements.

Coordinates: Absolute Unity world metres, Y up; no legacy actor X mirror. Root pivot and renderer bottom may differ.

Requires: Registered scenery and the transform scene operation. This scenery transform operation rejects objects already promoted with makeCSObject. Use documented actor position/rotation/scale for intentional placement/reset after promotion, and physics for ongoing motion.

Save and cleanup: Current placement appears in subsequent scenery/movie-set exports; this call itself writes no save file.

await moveModel("dock", 20, 1, 35);

setSceneObject

setSceneObject(name, options)

Purpose: Set selected position, rotation and/or scale fields on an existing scenery root.

Arguments and limits: Options may contain position, rotation or scale vectors with explicit numeric x/y/z components. Unspecified whole vectors remain unchanged; do not rely on omitted vector components retaining their old values. Position/rotation must be finite; every scale component must be in (0,100]. Whole-model transform changes are rejected while independent part rigidbodies exist.

Result: Promise resolving to the updated getSceneObject item.

Effects: Directly edits selected root transforms and calls Physics.SyncTransforms. Does not ground the object or resolve overlap. Do not use repeated transform writes to override physics motion.

Completion: Await completion. A timeout does not establish whether the transform was applied.

Coordinates: Absolute world position in metres and world Euler rotation in degrees; root localScale is dimensionless. No actor X mirroring.

Requires: Existing registered scenery and the scene transform operation. Use student helpers moveModel/setModelHeight when they express the desired operation. This scenery transform operation rejects objects already promoted with makeCSObject. Use documented actor position/rotation/scale for intentional placement/reset after promotion, and physics for ongoing motion.

Save and cleanup: Subsequent scenery state captures current transforms. Save explicitly through the movie-set lifecycle.

await setSceneObject("cabin", {rotation: {x: 0, y: 90, z: 0}});

setSceneVisible

setSceneVisible(name, visible)

Purpose: Show or hide the visual renderers of a scenery object.

Arguments and limits: Use true or false. The JavaScript wrapper coerces the value to a boolean, so the string "false" would actually show the object. Name must identify registered scenery.

Result: Promise resolving to the raw scene reply, including the updated item.

Effects: Changes the saved visible flag and enables/disables all visual child renderers, including inactive children. Does not deactivate the root, remove colliders, disable a Rigidbody or remove the object from the registry. Invisible scenery may still block movement. Also works on a promoted GLB actor; hiding does not unregister it or suspend its physics.

Completion: Await the scene reply before dependent operations.

Coordinates: No coordinate arguments.

Requires: Existing scenery and the visible scene operation.

Save and cleanup: The visible flag is included in scenery state for the movie-set export/restore path; hiding is not unloading.

await setSceneVisible("cabin", false);

removeSceneObject

removeSceneObject(name)

Purpose: Remove one imported scenery instance from the live scene registry.

Arguments and limits: Name must identify existing scenery. Removing an unknown name fails; this operation is not idempotent. It does not delete the asset file on the server or remove a stock CS actor.

Result: Promise resolving to the raw successful scene reply, without a replacement item.

Effects: If the scene instance was promoted with makeCSObject, unregisters its Unity and JavaScript actor entries and compacts shared-memory slots before removal. A refused browser unregister retains the object during ordinary removal. Then removes the scene entry, disables its root and schedules Unity destruction. Decrements importer reference counts and disposes the importer at the final reference. It does not repair external references or delete hosted asset bytes.

Completion: Await the reply. The root is inactive when removed, while Unity destruction is deferred; inspect state before retrying after a timeout.

Coordinates: No coordinate arguments.

Requires: Existing scenery and the remove scene operation.

Save and cleanup: Future scene exports omit the instance. Previously saved manifests and source GLB files are unchanged until separately updated.

await removeSceneObject("temporaryRock");

weaponIK

await weaponIK(weapon, enabled=true, settings={})

Purpose: Enable or release arm IK on a wielded, grip-calibrated prop. For non-dancer characters only; dancer models use wieldWeapon and existing camera controls unchanged. Settings upperArm, forearm, elbowDirection and weight. Reject dancer models, dynamic bones, invalid chains or nonuniform bone scale.

Arguments and limits: Enable or release arm IK on a wielded, grip-calibrated prop. For non-dancer characters only; dancer models use wieldWeapon and existing camera controls unchanged. Settings upperArm, forearm, elbowDirection and weight. Reject dancer models, dynamic bones, invalid chains or nonuniform bone scale. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

getWeaponIK

await getWeaponIK(weapon)

Purpose: Read enabled, solver (twoBone), chain, weight, aim, targetLocalPosition, actual weapon position, handError/supportError in world metres and fault error. Disabled before setup is not proof of a working rig.

Arguments and limits: Read enabled, solver (twoBone), chain, weight, aim, targetLocalPosition, actual weapon position, handError/supportError in world metres and fault error. Disabled before setup is not proof of a working rig. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

moveWeapon

await moveWeapon(weapon,x,y,z)

Purpose: Request weapon origin in character-local coordinates; arm follows while weapon stays in actual hand. No character-root motion. Unreachable targets clamp; inspect getWeaponIK errors.

Arguments and limits: Request weapon origin in character-local coordinates; arm follows while weapon stays in actual hand. No character-root motion. Unreachable targets clamp; inspect getWeaponIK errors. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

rotateWeapon

await rotateWeapon(weapon,x,y,z)

Purpose: Request weapon orientation in character-local Euler degrees; wrist follows. Stops automatic aiming. Distinct from weaponRotation grip calibration.

Arguments and limits: Request weapon orientation in character-local Euler degrees; wrist follows. Stops automatic aiming. Distinct from weaponRotation grip calibration. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

aimWeapon

await aimWeapon(weapon,x,y,z)

Purpose: Aim the calibrated signed weapon axis toward a Unity-world point; continuous Unity arm update, no JavaScript timer.

Arguments and limits: Aim the calibrated signed weapon axis toward a Unity-world point; continuous Unity arm update, no JavaScript timer. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

aimWeaponWithCamera

await aimWeaponWithCamera(weapon,enabled=true)

Purpose: Aim continuously along the existing MainCamera direction. False returns to configured local rotation. Does not create a camera or grant testing control.

Arguments and limits: Aim continuously along the existing MainCamera direction. False returns to configured local rotation. Does not create a camera or grant testing control. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

weaponSupportHand

await weaponSupportHand(weapon,hand="leftHand",x=0,y=0,z=0,settings={})

Purpose: Bind other hand to a weapon-local foregrip. hand=false releases it. Optional rotation in weapon-local Euler degrees and explicit arm settings. No shared arm ownership.

Arguments and limits: Bind other hand to a weapon-local foregrip. hand=false releases it. Optional rotation in weapon-local Euler degrees and explicit arm settings. No shared arm ownership. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

weaponIKWeight

await weaponIKWeight(weapon,weight,seconds=0.2)

Purpose: Blend visual arm IK weight0..1 over0..10 seconds. Weight0 restores animated pose; weapon remains held. Does not pause whole-character animation or change gravity.

Arguments and limits: Blend visual arm IK weight0..1 over0..10 seconds. Weight0 restores animated pose; weapon remains held. Does not pause whole-character animation or change gravity. Read guide:weapon-ik for rig/coordinate limitations.

Result: IK readback (enabled, solver, chain, actual pose, reach errors, weight, aim); commands acknowledge configuration, inspect after a rendered frame for results.

Effects: Visual arm rotations only; preserves character physics/gravity. Never modifies dancer goals/CCD/animation. Held weapon retains previous attachment physics ownership.

Completion: Promise; await configuration. Inspect after a frame for solved pose.

Coordinates: moveWeapon/rotateWeapon character-local; aimWeapon Unity-world metres; support grip weapon-local. Y up, Euler degrees. Not legacy actor.pos mirrored X.

Requires: Matching script.js and weaponIKV1 WebGL; loaded weapon wielded on a real initialized hand rig.

Save and cleanup: Setup belongs in saved game script; clearRun/release restores arm pose. IK is not stored separately in scenery manifests.

await weaponIK("rifle"); await moveWeapon("rifle",0.25,1.3,0.5); await aimWeaponWithCamera("rifle");

Game Play and hidden outcomes

Game Play costs one coin on every saved-challenge attempt, including first and review plays. It puts the coin in the kitty and calls clearRun to rebuild the game. Editor Run is the separate authoring operation. Use the standard Game toolbar for Play, sound, coins and kitty.

lost()

Write bare lost() with no arguments in the hidden #begin ... #end check when the actual failure condition occurs. The server binds the game ID and paid-attempt ticket. Loss ends the attempt, pauses physics, releases keys, stops managed timers and locks controls. It charges no additional coin. The consumed ticket can no longer win the kitty. Another paid Play reloads via clearRun.

solved()

Keep the win condition in the same hidden section. Bare solved() uses the existing server-validated kitty award. Successful wins end the round. Authors cannot award themselves their own kitty.

replayGame()

Returns a Promise for the standard paid Play. Use only if a custom interface needs a Play handler; prefer the shared Game toolbar. Never implement local free restarts or manipulate balances.

Hidden means omitted from another player's editor, not inaccessible to browser developer tools. Server checks protect tickets and accounting, not proof of physical gameplay. Both checks execute separately after gameReady resolves. Authoring tools accept #begin/#end markers and publication saves their contents as the check field.

Browse all Game Play and hidden outcomes functions and related commands

Additional JavaScript command reference

These entries fill gaps found by checking every active SendMessage call against this page. Existing explanations above are preserved. Use the JavaScript function, not a raw Unity receiver name. For actor methods, replace object with the named CS object after it has loaded.

Checked against script.js and selected Unity receiver source on 2026-10-11. Source tracing is not a browser gameplay test and does not add a capability to the current build or agent allowlist. Commands here generally return no value or Promise; asynchronous callbacks are stated where present. Legacy rig functions require their prepared components and do not work on every GLB. Do not repeatedly reposition dynamic physics objects with timers.

New entries: 147 source explanations, 9 known wrapper/receiver limitations, and 30 routes with no matching receiver in the selected source. The latter two categories are not recommendations for use.

Source-traced commands

clearAllBadges

clearAllBadges()

clearAllBadges() cancels badge timers and destroys all badges managed by BadgeSystem. This does not clear the HTML game control panel.

Unity target: ClearAllBadges. JavaScript lines: 5807, 5811. Status: source-traced; runtime not verified in this audit.

object.raycast

object.raycast(target)

object.raycast(target) asks the actor's physics component to check line of sight to an exact name and active objects whose names contain target, case-insensitively. Unity later assigns object.raycasthit an array sorted by distance (empty array for no results). It is not a synchronous return and is not the newer general raycast API; use a loaded CS actor with this method and wait for the callback update.

Unity target: Raycast. JavaScript lines: 1249, 1282, 1311, 1340, 1367, 1401, 1437, 1462, 1488, 1512, 1547, 1576, 1605, 1645, 1672, 1753, 1801, 1846, 1894, 1939, 1989, 2044, 2112, 2148, 2186, 2224, 2246, 2267, 2285, 2303, 2322, 2356, 2390, 2430, 2454, 2516, 2538, 2559, 2582, 2605, 2629, 2652, 2675, 2715, 2740, 2763, 2803, 2856, 2947, 2968, 2989, 3010, 3031, 3052, 3073, 3094, 3115, 3136, 3157, 3178, 3199, 3220, 3274, 3298, 3324, 3347, 3374, 3398, 3425, 3460, 3480, 3500, 3516, 3532, 3549, 3566, 3584, 3601, 3619. Status: source-traced; runtime not verified in this audit.

addAssetDictionary

addAssetDictionary(dictionaryinfo)

Registers a legacy bundle dictionary entry using a single string: bundleName^items^URL. Existing entries are left unchanged. This registers metadata, not a downloaded model or CS actor. Prefer the normal load(type,name) or documented GLB pipeline for game authoring.

Unity target: addAssetDictionary. JavaScript lines: 8548. Status: source-traced; runtime not verified in this audit.

addDontGrab

addDontGrab(who,what)

For a prepared grabbing character, addDontGrab(who,what) broadcasts the excluded object name to its existing grab components. The target must implement that receiver. It does not add grabbing behavior to an arbitrary GLB.

Unity target: addDontGrab. JavaScript lines: 8418. Status: source-traced; runtime not verified in this audit.

addSpeechBubble

addSpeechBubble(who,text,type,time,x,y,z)

addSpeechBubble(who,text,type,time,x,y,z) attaches a bubble to an existing object's transform, stores it under that object name, and supplies a duration and positional offset. A SpeechBubbleManager and its bundled assets are required. type is the package's integer enum, not a free-form string; its numeric choices need package verification before use. Text and object names cannot contain ^ because the wrapper uses it as the separator. The wrapper has no defaults and returns no Promise.

Unity target: addSpeechBubble. JavaScript lines: 8269. Status: source-traced; runtime not verified in this audit.

addSpeechBubbleManager

addSpeechBubbleManager()

Instantiates the bundled Speechbubble Manager TMP resource and names it SpeechBubbleManager. Required before these legacy Unity speech-bubble calls when no manager exists. Do not repeatedly create duplicate managers.

Unity target: addSpeechBubbleManager. JavaScript lines: 8261. Status: source-traced; runtime not verified in this audit.

cancelAnimations

cancelAnimations()

cancelAnimations() clears the legacy LeanTween registry and calls LeanTween.cancelAll(true). This affects all LeanTweens, and may invoke their completion callbacks; it is not a universal stop command for GLB clips, Animator states or physics.

Unity target: cancelLeans. JavaScript lines: 6662. Status: source-traced; runtime not verified in this audit.

changeParticles

changeParticles(json)

changeParticles(json) configures the particle system previously selected by initializeParticles: type, maxparticles, collisionsenabled, collisionbounce and emissionrate are read, and duration is parsed but not applied. The receiver parses the numeric/boolean fields from strings. It stops, clears, and restarts that system. The supplied name does not select another system; colors/sizes in commented code are not implemented. This is shared-particle plumbing, not a general smoke preset API.

Unity target: changeParticles. JavaScript lines: 9095, 9121. Status: source-traced; runtime not verified in this audit.

clearSpeechBubbles

clearSpeechBubbles()

Clears all bubbles through the existing SpeechBubbleManager instance. The manager must be present.

Unity target: clearSpeechBubbles. JavaScript lines: 8277. Status: source-traced; runtime not verified in this audit.

setConservationOn

setConservationOn(goname)

Sets the named actor's existing physics.conservation flag to true. This is the legacy custom physics mode, not a guarantee that an arbitrary game conserves physical quantities or a replacement for normal force/velocity controls.

Unity target: conservationOn. JavaScript lines: 8058. Status: source-traced; runtime not verified in this audit.

dontDragEverything

dontDragEverything()

Disables the dragitold component on Main Camera. This is the counterpart to dragEverything() and requires that legacy component to exist.

Unity target: dontDragEverything. JavaScript lines: 7828. Status: source-traced; runtime not verified in this audit.

freezeParts

freezeParts(goname)

Makes all Rigidbody components in the named object's active hierarchy kinematic, including the root when present. It changes the physics of the entire prepared character or mechanism. Do not use this to seat a dynamic passenger; freezing a rig can stop its movement/animation. The similarly named release wrapper has a separate unresolved receiver entry below.

Unity target: freezeParts. JavaScript lines: 8224. Status: source-traced; runtime not verified in this audit.

object.getAnchorPosition

object.getAnchorPosition()

For a loaded cannon, object.getAnchorPosition() updates object.anchorPosition asynchronously. The cannon receiver places its internal anchor at local (0,0,-11), transforms it through the gun, negates X for the returned CS vector, then calls back into JavaScript. This is a cannon-specific anchor, not a general model-bounds query.

Unity target: getAnchorPosition. JavaScript lines: 2085. Status: source-traced; runtime not verified in this audit.

object.getAtomPositionData

object.getAtomPositionData()

For an atoms object, object.getAtomPositionData() later fills object.atompositiondata with comma-separated XYZ positions for all atoms, including a trailing comma. The source sends Unity world coordinates without X conversion; it does not synchronously return a JavaScript vector array.

Unity target: getAtomPositionData. JavaScript lines: 2506. Status: source-traced; runtime not verified in this audit.

object.getAtomVelocityData

object.getAtomVelocityData()

For an atoms object, object.getAtomVelocityData() later fills object.atomvelocitydata with comma-separated XYZ Rigidbody velocities, including a trailing comma. It uses Unity coordinates without X conversion and does not synchronously return the data.

Unity target: getAtomVelocityData. JavaScript lines: 2509. Status: source-traced; runtime not verified in this audit.

getCameraOffsets

getCameraOffsets(goname)

Requests offsets from the named object to the current world camera. The asynchronous JavaScript receiver displays an alert containing a proposed setCamera(...) statement. There is no returned settings object or Promise.

Unity target: getCameraOffsets. JavaScript lines: 7943. Status: source-traced; runtime not verified in this audit.

getCameraSettings

getCameraSettings()

Requests the current camera field of view, position and quaternion rotation. The JavaScript callback displays an alert containing a setCameraSettings(...) statement; it does not return a value to the caller.

Unity target: getCameraSettings. JavaScript lines: 7939. Status: source-traced; runtime not verified in this audit.

getCubePosition

getCubePosition()

Internal/demo readback of the first registered Unity object's position through getCubePositionCB. It assumes at least one object exists and does not accept an object name. Use the named CS object's shared position for normal gameplay.

Unity target: getCubePosition. JavaScript lines: 428. Status: source-traced; runtime not verified in this audit.

gravityOn

gravityOn(goname)

Enables useGravity on the named object's Rigidbody; for prepared dancer actors it also enables gravity on their child bodies. It does not change the global gravity vector or the CS acceleration property. Requires an existing Rigidbody.

Unity target: gravityOn. JavaScript lines: 7204. Status: source-traced; runtime not verified in this audit.

handGrabAttachToCenterOff

handGrabAttachToCenterOff(who)

Broadcasts handGrabAttachToCenterOff to existing grab components on the named character. Requires the prepared grabbing implementation.

Unity target: handGrabAttachToCenterOff. JavaScript lines: 8404. Status: source-traced; runtime not verified in this audit.

handGrabAttachToCenterOn

handGrabAttachToCenterOn(who)

Broadcasts handGrabAttachToCenterOn to the named prepared character's grab components. It selects their center-attachment behavior; it does not create a grip, IK rig, or grab component on an arbitrary model.

Unity target: handGrabAttachToCenterOn. JavaScript lines: 8399. Status: source-traced; runtime not verified in this audit.

hideFoliage

hideFoliage(terrainName)

Turns off drawTreesAndFoliage on the named Unity Terrain. It hides that terrain's built-in trees/detail foliage; it does not delete instances, hide independently loaded GLB trees, or change terrain heights.

Unity target: hideFoliage. JavaScript lines: 8088. Status: source-traced; runtime not verified in this audit.

hideSky

hideSky(b)

hideSky() disables the Skybox component on Main Camera, switches to solid-color clearing and sets the background to transparent black. The declared argument is unused. Call setBackgroundColor afterward if a particular color is wanted.

Unity target: hideSky. JavaScript lines: 7191. Status: source-traced; runtime not verified in this audit.

hideWeights / setFootBalance

hideWeights(goname)
setFootBalance(goname,b)

hideWeights(goname) hides MeshRenderers on the prepared left/right hand and foot weight objects. It changes visibility only. Warning: setFootBalance(goname,b) is also routed here with a comma-suffixed name, so that wrapper does not implement foot balancing and must not be used for it.

Unity target: hideWeights. JavaScript lines: 7928, 7933. Status: source-traced; runtime not verified in this audit.

initializeParticles

initializeParticles()

initializeParticles() selects the hard-coded object named particles and allocates a buffer using that ParticleSystem's maximum particle count. A ParticleSystem must already exist there. It does not load a particle prefab and takes no system-name argument.

Unity target: initializeParticleSystem. JavaScript lines: 9100. Status: source-traced; runtime not verified in this audit.

addActionTarget

addActionTarget(goname,targetname)

Adds targetname to the named dancer character's action targets through its existing addActionTarget method. Both names are comma-separated by the wrapper. It requires a prepared dancer; it is not a general AI-agent planner or navigation feature.

Unity target: jaddActionTarget. JavaScript lines: 7099. Status: source-traced; runtime not verified in this audit.

javascriptControlOff

javascriptControlOff( goalname)

For a registered CS object, sets javascriptcontrol false in both registries. It does not unload the object. The wrapper only sends the command when the name is already present in the JavaScript objects registry.

Unity target: javascriptControlOff. JavaScript lines: 5929. Status: source-traced; runtime not verified in this audit.

javascriptControlOn

javascriptControlOn( goalname)

For a registered CS object, sets javascriptcontrol true in both the JavaScript registry and matching Unity object record. It is shared-memory control plumbing, especially for prepared goals, and does not add physics or register a new GLB. Do not use it as a reason to repeatedly teleport a dynamic physics actor.

Unity target: javascriptControlOn. JavaScript lines: 5917. Status: source-traced; runtime not verified in this audit.

constrain

constrain(who,info)

constrain(who,info) applies the existing Rigidbody constraint preset. The helper recognizes only 001,111; 001,000; 001,100; 001,011; 001,110; 000,111; 000,101; 001,101; 001,010; 001,001; and 000,000. These encode position XYZ followed by rotation XYZ, with 1 freezing an axis. It is a fixed preset list, not a general six-bit parser; other strings do nothing. The helper also returns without change when the global ccdtype is ape.

Unity target: jconstrain. JavaScript lines: 7844. Status: source-traced; runtime not verified in this audit.

dragItNoY

dragItNoY(who,bool)

Sets the prepared dancer's dragitnoy boolean using dragItNoY(who,bool). It controls that rig's dragging mode; it is not a universal Rigidbody Y constraint and does not install a controller.

Unity target: jdragItNoY. JavaScript lines: 7820. Status: source-traced; runtime not verified in this audit.

dynamicZoomOff

dynamicZoomOff()

dynamicZoomOff() clears the current camera motion's dynamicZoom flag. It does not reset camera position or disable every camera behavior.

Unity target: jdynamicZoomOff. JavaScript lines: 5432. Status: source-traced; runtime not verified in this audit.

getElasticity

getElasticity(s)

getElasticity(name) writes the named object's collider bounciness to the Unity console. It does not return a numeric value or update a JavaScript variable.

Unity target: jgetBounciness. JavaScript lines: 9148. Status: source-traced; runtime not verified in this audit.

getFriction

getFriction(s)

getFriction(name) writes the named collider's static and dynamic friction to the Unity console. It does not return a value or Promise.

Unity target: jgetFriction. JavaScript lines: 9144. Status: source-traced; runtime not verified in this audit.

removeActionTarget

removeActionTarget(goname,targetname)

Removes targetname from the named dancer character's action targets. Requires that prepared character component; this does not delete the target from the scene.

Unity target: jremoveActionTarget. JavaScript lines: 7105. Status: source-traced; runtime not verified in this audit.

setAngularDrag

setAngularDrag(goname, f)

Sets angular damping on the named root Rigidbody. It does not set linear drag or recurse through the character's child bodies. Pass an existing name and a nonnegative numeric damping value.

Unity target: jsetAngularDrag. JavaScript lines: 6973. Status: source-traced; runtime not verified in this audit.

setBalance

setBalance(goname, b)

For a prepared dancer, changes its balance boolean; otherwise it enables/disables an already attached balanceScript. The fallback does not add that component. This is rig-specific balancing, not a generic controller for every GLB.

Unity target: jsetBalance. JavaScript lines: 6906. Status: source-traced; runtime not verified in this audit.

setBalanceHeight

setBalanceHeight(who,height)

Sets the prepared dancer's balanceheight numeric setting. It is a rig parameter, not a request to move the terrain or directly teleport the actor to a Y coordinate.

Unity target: jsetBalanceHeight. JavaScript lines: 7840. Status: source-traced; runtime not verified in this audit.

setBalanceLerp

setBalanceLerp(who, f)

Sets the prepared dancer's balancelerp numeric parameter. The receiver supplies no clamping or general-model balancing fallback; requires the existing rig.

Unity target: jsetBalanceLerp. JavaScript lines: 7853. Status: source-traced; runtime not verified in this audit.

setBoxCollider

setBoxCollider(who, b)

Enables/disables the named object's existing root BoxCollider. It does not add a collider, affect child colliders, or convert a MeshCollider to a box.

Unity target: jsetBoxCollider. JavaScript lines: 7849. Status: source-traced; runtime not verified in this audit.

setCCDHoldPose

setCCDHoldPose(goname,f)

Sets the prepared dancer's ccdholdpose boolean. Despite the JavaScript parameter name f, the receiver parses a boolean. This belongs to the existing dancer IK system; do not install or override another solver for dancer characters.

Unity target: jsetCCDHoldPose. JavaScript lines: 7046. Status: source-traced; runtime not verified in this audit.

setCCDLerpSpeed

setCCDLerpSpeed(goname,f)

Sets the prepared dancer's ccdLerpSpeed numeric parameter. It requires that rig's existing CCD implementation; there is no universal GLB IK setup here.

Unity target: jsetCCDLerpSpeed. JavaScript lines: 7040. Status: source-traced; runtime not verified in this audit.

setCCDType

setCCDType(goname,s)

Stores the supplied string in the prepared dancer's ccdtype setting. The bridge itself does not validate an enum. Do not invent a CCD mode from its name; supported values require the rig's implementation/examples.

Unity target: jsetCCDType. JavaScript lines: 7034. Status: source-traced; runtime not verified in this audit.

setDragK1

setDragK1(goname,f)

Sets the prepared dancer's dragK1 numeric tuning parameter. It does not move a model directly or create a drag controller; use only with the existing rig and a tested tuning value.

Unity target: jsetDragK1. JavaScript lines: 6998. Status: source-traced; runtime not verified in this audit.

setDragK2

setDragK2(goname,f)

Sets the prepared dancer's dragK2 numeric tuning parameter. It does not move a model directly or create a drag controller; use only with the existing rig and a tested tuning value.

Unity target: jsetDragK2. JavaScript lines: 7004. Status: source-traced; runtime not verified in this audit.

setDragbyhitbone

setDragbyhitbone(goname, b)

Sets the prepared dancer's dragByHitbone boolean, selecting that rig's hit-bone dragging behavior. It does not resolve a GLB bone or add IK by itself.

Unity target: jsetDragbyhitbone. JavaScript lines: 6992. Status: source-traced; runtime not verified in this audit.

setDragit

setDragit(goname, b)

Sets both dragit and ccddrag on the prepared dancer to the supplied boolean. It requires the existing dancer and controls its drag/CCD behavior, not the whole page's mouse input.

Unity target: jsetDragit. JavaScript lines: 6979. Status: source-traced; runtime not verified in this audit.

setDriveDampers

setDriveDampers( goname,  f)

Sets positionDamper on the angular X and YZ drives of each ConfigurableJoint in the named object's active hierarchy. It does not create joints or change linear joint drives. Broad changes can affect an entire prepared character.

Unity target: jsetDriveDampers. JavaScript lines: 7144. Status: source-traced; runtime not verified in this audit.

setDriveSprings

setDriveSprings( goname,  f)

Sets positionSpring on the angular X and YZ drives of each ConfigurableJoint in the named object's active hierarchy. It does not create joints or change linear joint drives. Broad changes can affect an entire prepared character.

Unity target: jsetDriveSprings. JavaScript lines: 7133. Status: source-traced; runtime not verified in this audit.

setEyeson

setEyeson(goname, b)

Sets the prepared dancer's eyeson boolean. Requires its existing eye behavior; it is not a material-emission or general eye-animation command for arbitrary models.

Unity target: jsetEyeson. JavaScript lines: 7064. Status: source-traced; runtime not verified in this audit.

setFrontstep

setFrontstep(goname, b)

Sets the prepared dancer's frontstep boolean. This selects existing rig behavior; it does not create walk animations or a character controller.

Unity target: jsetFrontstep. JavaScript lines: 6955. Status: source-traced; runtime not verified in this audit.

setHandGrab

setHandGrab(goname, b)

Calls the dancer's setHandgrab with the boolean and also calls useWeights with the same value. Turning hand grabbing on/off therefore affects the prepared weight system used for throwing; it is not merely a visual hand toggle.

Unity target: jsetHandgrab. JavaScript lines: 6924. Status: source-traced; runtime not verified in this audit.

setHeadache

setHeadache(goname,f)

Sets the prepared dancer's numeric headache value. It does not by itself implement a game's hidden loss condition, scoring or universal damage system.

Unity target: jsetHeadache. JavaScript lines: 7022. Status: source-traced; runtime not verified in this audit.

setHeadacheThreshold

setHeadacheThreshold(goname,f)

Finds the dancer's mapped head bone and changes its headcollisionmanager.headacheThreshold. Requires the prepared bone map and head collision component; it does not work on arbitrary unrigged GLBs.

Unity target: jsetHeadacheThreshold. JavaScript lines: 7028. Status: source-traced; runtime not verified in this audit.

setHeadtowing

setHeadtowing(goname, b)

Sets the prepared dancer's headtowing boolean. It selects behavior already implemented by that rig and does not create a joint or tow cable.

Unity target: jsetHeadtowing. JavaScript lines: 7052. Status: source-traced; runtime not verified in this audit.

setHealth

setHealth(goname,f)

Sets the prepared dancer's health numeric field. It is not a universal health component for scenery and does not automatically define the challenge's hidden lost()/solved() rules.

Unity target: jsetHealth. JavaScript lines: 7016. Status: source-traced; runtime not verified in this audit.

setHips

setHips(goname, b)

Sets the prepared dancer's hips boolean. It requires the existing rig; it does not reposition a named hip bone or add an animation track.

Unity target: jsetHips. JavaScript lines: 6943. Status: source-traced; runtime not verified in this audit.

setLerpZAdjust

setLerpZAdjust(who,f)

Sets the prepared dancer's lerpZAdjust numeric parameter. This is an existing rig tuning value, not a general world-space Z-position command.

Unity target: jsetLerpZAdjust. JavaScript lines: 7861. Status: source-traced; runtime not verified in this audit.

setMaterial

setMaterial(goname,materialname)

Loads a material already bundled under Materials/ (adds that prefix if absent) and assigns it to the named Terrain's materialTemplate or root Renderer's material. A missing resource is not downloaded. It is not a URL texture loader; use the documented texture APIs for external images.

Unity target: jsetMaterial. JavaScript lines: 7865. Status: source-traced; runtime not verified in this audit.

setMaxDragForce

setMaxDragForce(goname,f)

Sets the prepared dancer's maxdragforce numeric limit. Requires the rig's drag behavior; this is not a force applied to an arbitrary Rigidbody.

Unity target: jsetMaxDragForce. JavaScript lines: 7010. Status: source-traced; runtime not verified in this audit.

setMouseControlType

setMouseControlType(goname, s)

Stores the supplied string in the prepared dancer's mouseControlType. The bridge validates no choices; use an existing demonstrated mode and do not invent mode names. It does not route webpage focus or keyboard events.

Unity target: jsetMouseControlType. JavaScript lines: 7070. Status: source-traced; runtime not verified in this audit.

setRecordLimit

setRecordLimit(goname,f)

Sets the prepared dancer's recordlimit using integer parsing. A fractional or nonnumeric value is invalid. This configures the rig recorder, not a media-upload size limit.

Unity target: jsetRecordLimit. JavaScript lines: 7058. Status: source-traced; runtime not verified in this audit.

setSidestep

setSidestep(goname, b)

Sets the prepared dancer's sidestep boolean. It enables/disables existing rig behavior; it does not synthesize a new animation or create a controller.

Unity target: jsetSidestep. JavaScript lines: 6961. Status: source-traced; runtime not verified in this audit.

setSphereControlAxis

setSphereControlAxis(who,axis)

Stores a string in the prepared dancer's spherecontrolaxis. The bridge does not validate available modes; use the prepared rig's demonstrated choices. It does not constrain a generic sphere collider.

Unity target: jsetSphereControlAxis. JavaScript lines: 7836. Status: source-traced; runtime not verified in this audit.

setSphereControlDistance

setSphereControlDistance(who,f)

Sets the prepared dancer's spherecontroldistance numeric setting. Requires the existing rig controller; this is not a general collision radius or distance query.

Unity target: jsetSphereControlDistance. JavaScript lines: 7832. Status: source-traced; runtime not verified in this audit.

setCameraLerp

setCameraLerp(f)

setCameraLerp(f) changes the existing camera controller's swooplerp numeric setting. It does not add another camera or change physics interpolation. The bridge applies no clamping.

Unity target: jsetSwoopLerp. JavaScript lines: 7857. Status: source-traced; runtime not verified in this audit.

setSymmetryType

setSymmetryType(goname, s)

Stores the supplied string in the prepared dancer's symmetryType. Supported choices must come from that rig's examples/implementation; the bridge itself validates none.

Unity target: jsetSymmetryType. JavaScript lines: 7076. Status: source-traced; runtime not verified in this audit.

setTargetPunch

setTargetPunch(goname,punch)

Sets the prepared dancer's targetPunch numeric parameter. This tunes existing behavior; it does not create a punch animation or implement the game's damage rules.

Unity target: jsetTargetPunch. JavaScript lines: 7110. Status: source-traced; runtime not verified in this audit.

setThrowing

setThrowing(goname, b)

Sets the prepared dancer's throwing boolean. Requires its grab/throw rig; it does not make any arbitrary GLB into a throwable CS actor.

Unity target: jsetThrowing. JavaScript lines: 6931. Status: source-traced; runtime not verified in this audit.

setThrust

setThrust(goname, b)

Sets the prepared dancer's thrust boolean. It is a prepared-rig behavior switch, not a numeric impulse or a generic propulsion force.

Unity target: jsetThrust. JavaScript lines: 6949. Status: source-traced; runtime not verified in this audit.

setWeightsMass

setWeightsMass(goname, f)

Sets the mass of all four prepared hand/foot weight Rigidbodies to the supplied number. It does not change the root actor's mass. This can strongly change rig behavior; do not change it merely to place a passenger.

Unity target: jsetWeightsMass. JavaScript lines: 6918. Status: source-traced; runtime not verified in this audit.

setWingit

setWingit(goname, b)

Sets the prepared dancer's wingit boolean. It switches an existing rig behavior; it does not add wings, skeletal animation or flight physics to a GLB.

Unity target: jsetWingit. JavaScript lines: 6937. Status: source-traced; runtime not verified in this audit.

dragEverything

dragEverything()

dragEverything() enables the legacy dragitold component on Main Camera. That component must already exist; this does not install it or confer team/browser control.

Unity target: jsetdragEverything. JavaScript lines: 7824. Status: source-traced; runtime not verified in this audit.

hideGoals / showGoals

hideGoals(goname)
showGoals(goname)

showGoals(goname)/hideGoals(goname) enable/disable MeshRenderers on the prepared gonamegoal1 and gonamegoal2 objects. Only visibility changes; IK goals are not created or removed and their physics/control remain in place.

Unity target: jshowGoals. JavaScript lines: 7916, 7920. Status: source-traced; runtime not verified in this audit.

useWeights

useWeights(goname, b)

Sets useWeights on the prepared dancer to the supplied boolean. It requires the prebuilt rig and is separate from showing weight markers or setting their masses.

Unity target: juseWeights. JavaScript lines: 6912. Status: source-traced; runtime not verified in this audit.

loadAssetBundle

loadAssetBundle(bundlename)

Downloads a legacy bundle from its previously registered AssetDictionary path. It updates progress and loaded through JavaScript callbacks after completion. It does not instantiate an actor or return a Promise. Prefer load(type,name) for stock CS objects; do not confuse bundle names with Sketchfab GLB URLs.

Unity target: loadAssetBundle. JavaScript lines: 8075. Status: source-traced; runtime not verified in this audit.

loadImage

loadImage(url,left,top,width,height,duration,speed)

loadImage(url,left,top,width,height,duration,speed) downloads an image into a Unity screen overlay anchored at the top left. Layout uses a 1920x1080 reference canvas; left/top set position and width/height set size. A negative duration keeps it visible, zero clears it after loading, and a positive duration clears it after that many scaled seconds. Nonzero speed enables the existing scrolling behavior. An empty URL clears the canvas. The URL must be reachable with appropriate CORS and must not contain ^, the field delimiter. This wrapper has no Promise or completion callback; it replaces the prior image canvas.

Unity target: loadImage. JavaScript lines: 9235. Status: source-traced; runtime not verified in this audit.

loadScenery

loadScenery(sname)

Legacy Resources loader: instantiates a GameObject already included in the build under the supplied resource name. The source itself logs that this route does not work; treat it as an unverified legacy path, not a URL importer or the movie-set loader. Use the documented movie-set/GLB API for new work.

Unity target: loadScenery. JavaScript lines: 8080. Status: source-traced; runtime not verified in this audit.

logPhysicsSettings

logPhysicsSettings(goname)

Logs the named object's child collider settings and root Rigidbody settings to the Unity console, including mass, damping, gravity, constraints and interpolation. It does not return a JavaScript object or Promise. It is a diagnostic, not an instruction to modify those components directly from CS.

Unity target: logPhysicsSettings. JavaScript lines: 8808. Status: source-traced; runtime not verified in this audit.

maintainGroundOrientation

maintainGroundOrientation(who,bool)

Sets the named actor's existing physics.maintainGroundOrientation boolean. It requires the CS physics component and enables its orientation behavior; it does not turn a static scenery model into a CS object or change terrain height.

Unity target: maintainGroundOrientation. JavaScript lines: 8141. Status: source-traced; runtime not verified in this audit.

maintainSpeed

maintainSpeed(who,speed)

Sets the CS physics component's maintained speed mode and target. Positive speed enables it; zero or a negative value disables it and clears the target, so negative values do not request reverse. The physics loop only adjusts velocity when its downward raycast distance from the transform origin is less than 0.2; this may not suit a tall actor. It approaches forward * speed with a 0.1 interpolation factor. It is an ongoing engine behavior, not a one-time velocity assignment or a JavaScript teleport loop.

Unity target: maintainSpeed. JavaScript lines: 8133. Status: source-traced; runtime not verified in this audit.

maintainYRotationSpeed

maintainYRotationSpeed(who,speed)

Sets the CS physics component's maintained Y rotation mode and target. Positive values enable it; zero or negative values disable it. A negative number does not mean spin the opposite way through this wrapper. Like maintainSpeed, the physics loop gates adjustment on a downward-ray distance below 0.2 from the transform origin, then approaches the target angular velocity with a 0.1 factor.

Unity target: maintainYRotationSpeed. JavaScript lines: 8137. Status: source-traced; runtime not verified in this audit.

maximizeJointLimits

maximizeJointLimits(who)

Sets every ConfigurableJoint in the named active hierarchy to high X/Y/Z limits of 175 degrees and low X of -175 degrees. It can substantially change an entire prepared rig; it is not a one-joint adjustment and does not save the old limits in this method.

Unity target: maximizeJointLimits. JavaScript lines: 8383. Status: source-traced; runtime not verified in this audit.

measureDistance

measureDistance(goname1,goname2,addxy,fontsize)

measureDistance(a,b,addxy,fontsize) adds a Unity distance-line component to a and points it at b. addxy defaults false; fontsize defaults 8 and is divided by four for Unity. Both named objects must exist. It draws a measurement rather than returning a number. Duplicate recorded pairs are rejected; prefer one line per starting object because removal is keyed by the starting name.

Unity target: measureDistance. JavaScript lines: 8013. Status: source-traced; runtime not verified in this audit.

measureGroundDistanceOff

measureGroundDistanceOff(who)

Disables periodic ground-distance measurement on the actor's existing CS physics component. It does not alter the terrain or the actor's colliders.

Unity target: measureGroundDistanceOff. JavaScript lines: 8149. Status: source-traced; runtime not verified in this audit.

measureGroundDistanceOn

measureGroundDistanceOn(who)

Enables periodic ground-distance measurement on the actor's existing CS physics component. Successful downward raycasts from the collider bottom later update object.groundDistance; misses leave the old value. It does not return a distance immediately or install that component on a scenery model.

Unity target: measureGroundDistanceOn. JavaScript lines: 8145. Status: source-traced; runtime not verified in this audit.

noCollisions

noCollisions(goname)

Changes the named root Collider to a trigger (isTrigger=true). It does not disable/remove the collider or recursively affect every child collider. Trigger events may still occur. This changes physical contacts, so do not use it casually on a standing player or vehicle.

Unity target: noCollisions. JavaScript lines: 4217, 8027. Status: source-traced; runtime not verified in this audit.

parentObject

parentObject(goname,parentname)

parentObject(child,parent) first calls the child's CS freeze() method, then parents its Unity Transform while preserving world position. Both objects must already exist and the child must be a CS object. This changes physics participation; it is not an inert visual attachment and is unsuitable for seating a dynamic penguin passenger. Never repeatedly position a dynamic passenger on a timer.

Unity target: parentObject. JavaScript lines: 7994. Status: source-traced; runtime not verified in this audit.

pauseAnimation

pauseAnimation(who,speed)

For a root Animator, sets speed to zero. For a root legacy Animation, stops playback and restores joints; it is not a resumable pause in that legacy branch. The JavaScript speed argument is ignored. Prefer the newer model-animation API for imported GLBs and inspect their animation player type first.

Unity target: pauseAnimation. JavaScript lines: 8125. Status: source-traced; runtime not verified in this audit.

physicsSettings

physicsSettings(type)

Selects the global physics preset macro or micro (case-insensitive). Macro uses bounce threshold 1, sleep threshold 0.08, max depenetration velocity 8, solver iterations 12/4 and contact offset 0.005. Micro uses 0.0001, 0, 50, 20/10 and 0.0001 respectively. These change global simulation settings; micro can cost more CPU and is not an automatic improvement for ordinary game objects. Unknown modes log a warning without applying a preset.

Unity target: physicsSettings. JavaScript lines: 9509. Status: source-traced; runtime not verified in this audit.

playAnimationFromMemory

playAnimationFromMemory()

Legacy recorded-animation playback: parses the shared animationMemory buffer and plays track 0. It is not a GLB clip player and requires recorded rig data to have been loaded into that buffer.

Unity target: playAnimationFromMemory. JavaScript lines: 6332. Status: source-traced; runtime not verified in this audit.

registerPlayerName

registerPlayerName(playerName)

Registers a name on an existing dancer object of that same name and sets multiplayer=true. This is legacy multiplayer wiring, not account sign-in, an ownership change or a general actor rename.

Unity target: registerPlayerName. JavaScript lines: 6387. Status: source-traced; runtime not verified in this audit.

object.registerVolume

object.registerVolume(s)

For a sensor prefab, object.registerVolume(s) stores s in its sensor volumeString. The receiver does not parse or validate it here; it is not a general audio-volume command. The sensor implementation must define the string format before authoring a new use.

Unity target: registerVolume. JavaScript lines: 2796. Status: source-traced; runtime not verified in this audit.

removeDistance

removeDistance(goname)

removeDistance(name) removes the distance line on the starting object, destroys its measureDistance component, and removes the first matching entry from the JavaScript registry. The argument is the starting object name, not a scene-wide clear operation.

Unity target: removeDistanceLine. JavaScript lines: 8017. Status: source-traced; runtime not verified in this audit.

removeDontGrab

removeDontGrab(who,what)

For a prepared grabbing character, removeDontGrab(who,what) broadcasts removal of an object from its grab exclusion list. This requires the prefab's existing grab components.

Unity target: removeDontGrab. JavaScript lines: 8422. Status: source-traced; runtime not verified in this audit.

removeScenery

removeScenery(sname)

Legacy name-based deletion: finds the named scene object and destroys it. The source flags this route as nonworking; it is not a verified counterpart to the modern movie-set/GLB loader. Use that loader's documented cleanup API.

Unity target: removeScenery. JavaScript lines: 8084. Status: source-traced; runtime not verified in this audit.

removeSpeechBubbleManager

removeSpeechBubbleManager()

Destroys the scene object named SpeechBubbleManager. This removes the Unity speech-bubble manager, not the HTML control panel.

Unity target: removeSpeechBubbleManager. JavaScript lines: 8265. Status: source-traced; runtime not verified in this audit.

repeatTextureFromScale

repeatTextureFromScale(who)

Sets the named root Renderer's material mainTextureScale to the object's local X/Y scale. It does not download textures, adjust Z tiling or repaint terrain splats. The material/shader must support that texture property.

Unity target: repeatTextureFromScale. JavaScript lines: 8426. Status: source-traced; runtime not verified in this audit.

restoreBoneInfo

restoreBoneInfo(who)

Restores local rotations in the named hierarchy from the dancer's saved BoneRestoreInfo entries. Requires a prepared dancer with that saved dictionary and matching bone names. It changes pose; it does not restore a whole movie-set manifest.

Unity target: restoreBoneInfo. JavaScript lines: 8389. Status: source-traced; runtime not verified in this audit.

screenshot

screenshot()

Legacy Unity screenshot request starts PrintRoutine. It returns no JavaScript image or Promise and is not the Workshop's getScreenshot/video review transport. Use the supported team screenshot capability for review images.

Unity target: screenshot. JavaScript lines: 8311. Status: source-traced; runtime not verified in this audit.

setAnimation

setAnimation(who,which,speed)

setAnimation(who,which,speed) targets enabled root Animator/legacy Animation components. Speed defaults to 1 when omitted or zero. Animator crossfades for one second and sets playback speed. The legacy branch disables joints, crossfades, enables animatePhysics and loops the named clip. This can conflict with prepared dancer physics. For imported GLBs use the documented model-animation API and available clip names; do not guess controller states.

Unity target: setAnimation. JavaScript lines: 8121. Status: source-traced; runtime not verified in this audit.

setAnimationSpeed

setAnimationSpeed(who,speed)

Changes speed on an enabled root Animator or each currently playing root legacy Animation state. It does not start a clip or find players nested in arbitrary imported GLBs. Use the newer model-animation API for those imports.

Unity target: setAnimationSpeed. JavaScript lines: 8129. Status: source-traced; runtime not verified in this audit.

setAppName

setAppName(appname)

Stores a string in Unity's legacy appname field. It does not rename or save a Workshop project, publish a challenge or change account ownership.

Unity target: setAppName. JavaScript lines: 6392. Status: source-traced; runtime not verified in this audit.

setBackgroundColor

setBackgroundColor(r,g,b,a)

setBackgroundColor(r,g,b,a) sets Main Camera's background using four integer bytes from 0 to 255 (including alpha). It does not itself disable the skybox; call hideSky() first for a solid-color background. This is not the normalized 0–1 color convention used by some newer APIs.

Unity target: setBackgroundColor. JavaScript lines: 7200. Status: source-traced; runtime not verified in this audit.

setCCDGravityOffOn

setCCDGravityOffOn(myname,b)

Sets the prepared dancer's ccdgravityoffon boolean using a string boolean. It configures that rig's CCD gravity behavior, not global gravity. The wrapper accepts one actor name and a boolean. Do not install a competing IK solver.

Unity target: setCCDGravityOffOn. JavaScript lines: 8098, 8100. Status: source-traced; runtime not verified in this audit.

setCameraFieldOfView

setCameraFieldOfView(n)

Sets the current world camera field of view using an integer degree value. The selected receivers accept int or a string parsed as int; use a numeric integer string such as "60" for the string receiver. It does not reposition or replace the camera or stop another camera controller from changing field of view later.

Unity target: setCameraFieldOfView. JavaScript lines: 7981. Status: source-traced; runtime not verified in this audit.

setCameraSettings

setCameraSettings(f,x,y,z,rx,ry,rz,rw)

Sets the existing world camera FOV, world position and quaternion (rx,ry,rz,rw), and stops the legacy swoop first. Rotation arguments are quaternion components, not Euler angles in degrees. Coordinates are assigned directly in Unity space without the usual CS X conversion. Prefer setCamera for ordinary student camera setup; this low-level restoration route needs care when another controller is active.

Unity target: setCameraSettings. JavaScript lines: 7977. Status: source-traced; runtime not verified in this audit.

setCenterOfMass

setCenterOfMass(goname)

Despite its name, setCenterOfMass(name) takes no position: it synchronizes transforms and calls ResetCenterOfMass on the root Rigidbody, restoring automatic calculation from colliders. It does not set a custom center or change mass.

Unity target: setCenterOfMass. JavaScript lines: 8234. Status: source-traced; runtime not verified in this audit.

setFixedTimeStep

setFixedTimeStep(s)

Sets Unity's global fixedDeltaTime in seconds. The wrapper converts the argument to a string. This affects all physics and performance; it is not FPS control or a fix for camera follow jitter. Existing JavaScript comments report simulation slowdown, so use only for explicit physics timing experiments. setTimeScale/simSpeed can overwrite this value.

Unity target: setFixedTimeStep. JavaScript lines: 9138. Status: source-traced; runtime not verified in this audit.

setGroundDistanceInterval

setGroundDistanceInterval(who,amount)

Sets the named CS physics component's groundDistanceInterval numeric timer threshold. Use a positive interval. The physics component compares it to a Time.deltaTime timer, so the interval is in scaled seconds. Successful raycasts later update object.groundDistance; the call does not synchronously return a ground height.

Unity target: setGroundDistanceInterval. JavaScript lines: 8153. Status: source-traced; runtime not verified in this audit.

setHandGrabThrowBoost

setHandGrabThrowBoost(who,boost)

Broadcasts a numeric throw boost to the named prepared character's existing grab components. It does not create a throw controller or apply an immediate projectile impulse.

Unity target: setHandGrabThrowBoost. JavaScript lines: 8409. Status: source-traced; runtime not verified in this audit.

object.setLoadObject

object.setLoadObject(loadobjectname)

For a cannon, object.setLoadObject(name) records the existing load object and ignores collisions between its collider and the cannon gun/base BoxColliders. It does not create, load, parent or position that object. Required cannon components and the load collider must exist.

Unity target: setLoadObject. JavaScript lines: 2098. Status: source-traced; runtime not verified in this audit.

object.setMass

object.setMass(m)

For an atoms prefab, object.setMass(m) sets every child Rigidbody's mass. It is specific to Atomsscript and is not the general CS actor mass property. Use a positive mass; no input clamp appears in this receiver.

Unity target: setMass. JavaScript lines: 2488. Status: source-traced; runtime not verified in this audit.

setMaterialBaseMap

setMaterialBaseMap(s)

Takes one string: objectName,imageURL. Downloads an image into the first child Renderer's material, sets _BaseMap and mainTexture, and resets _BaseMap scale/offset to one/zero. The object and renderer must exist; the URL must be browser reachable with appropriate CORS. Commas cannot appear in either field. Completion is asynchronous in Unity but this JavaScript wrapper returns no Promise.

Unity target: setMaterialBaseMap. JavaScript lines: 9645. Status: source-traced; runtime not verified in this audit.

setParticleUpdateType

setParticleUpdateType(s)

Selects the shared-particle update mode with the string position or velocity. The receiver stores the string; unsupported strings match neither update branch. Requires the selected ParticleSystem and SharedFloats buffer. This does not select a smoke/fire effect.

Unity target: setParticleUpdateType. JavaScript lines: 9115. Status: source-traced; runtime not verified in this audit.

setScene

setScene(s)

Legacy built-in scene replacement: hides registered objects, unloads the active Unity scene, then loads the supplied built-in scene name in Single mode. It is destructive and cannot download a movie-set manifest. Use loadMovieSet for modern scene content.

Unity target: setScene. JavaScript lines: 6658. Status: source-traced; runtime not verified in this audit.

object.setSize

object.setSize(size)

For an atoms prefab, object.setSize(size) sets local scale on every Transform in its hierarchy, not just individual visible atoms. Nested scales therefore compound. It is not a generic actor scale setter.

Unity target: setSize. JavaScript lines: 2491. Status: source-traced; runtime not verified in this audit.

object.setTemperature

object.setTemperature(temp)

For an atoms prefab, object.setTemperature(temp) randomizes each atom's XY velocity with range based on sqrt(2*temp/firstAtomMass), and stores velocity magnitude in its physics.temp field. Atoms and positive mass must exist; use nonnegative temp. Do not represent this approximation as a validated thermodynamic temperature in physical units.

Unity target: setTemperature. JavaScript lines: 2476. Status: source-traced; runtime not verified in this audit.

setTriggerRestoreTime

setTriggerRestoreTime(who,time)

Broadcasts a numeric trigger-restore time to existing components on the named prepared grabbing character. It depends on their implementation and does not change the physics timestep or make an arbitrary collider a trigger.

Unity target: setTriggerRestoreTime. JavaScript lines: 8414. Status: source-traced; runtime not verified in this audit.

setUpdateFieldFlag

setUpdateFieldFlag(bool)

Sets the existing Unity updateFieldFlag boolean. The JavaScript wrapper converts the value to text. This controls the legacy field-update machinery, not every frame of CS shared memory or the new terrain API.

Unity target: setUpdateFieldFlag. JavaScript lines: 6208. Status: source-traced; runtime not verified in this audit.

setUpdateFieldInterval

setUpdateFieldInterval(n)

Sets the existing Unity updateFieldInterval numeric setting. This is a legacy field-update interval, not a cap on rendered FPS or the global fixed timestep. The JavaScript wrapper forwards its argument unchanged; supply a numeric string such as "0.033" for the string receiver.

Unity target: setUpdateFieldInterval. JavaScript lines: 6196. Status: source-traced; runtime not verified in this audit.

showFoliage

showFoliage(terrainName)

Turns on drawTreesAndFoliage on the named Unity Terrain. It restores visibility of its existing trees/detail foliage; it does not scatter new models.

Unity target: showFoliage. JavaScript lines: 8093. Status: source-traced; runtime not verified in this audit.

showSky

showSky(b)

showSky() enables the existing Skybox component on Main Camera, selects skybox clearing and resets the background to transparent black. It does not fetch a new skybox texture. The declared argument is unused.

Unity target: showSky. JavaScript lines: 7195. Status: source-traced; runtime not verified in this audit.

showWeights

showWeights(goname)

Shows MeshRenderers on the prepared left/right hand and foot weight objects. Those named objects must exist; this does not add weights or change their mass.

Unity target: showWeights. JavaScript lines: 7924. Status: source-traced; runtime not verified in this audit.

socketStartCCD

socketStartCCD(so)

Internal multiplayer CCD input. Its actor-targeted receiver expects actorName:hitBonePath and starts that prepared dancer's CCD in socket mode. It is not a general weapon IK API or a command students should call to establish a network connection.

Unity target: socketStartCCD. JavaScript lines: 7270. Status: source-traced; runtime not verified in this audit.

speechBubbleManagerSize

speechBubbleManagerSize(x)

Changes the existing SpeechBubbleManager object's uniform local scale to x. It takes a numeric scale, not a screen-pixel size, and requires the manager to exist.

Unity target: speechBubbleManagerSize. JavaScript lines: 8281. Status: source-traced; runtime not verified in this audit.

stageBounciness

stageBounciness(f)

Sets bounciness on the built-in plane MeshCollider material. The receiver expects a numeric string, and the wrapper forwards its argument unchanged; use stageBounciness("0.2"). Use a value from 0 to 1. It does not affect a movie-set terrain or every collider in the scene.

Unity target: stageBounciness. JavaScript lines: 5719. Status: source-traced; runtime not verified in this audit.

stageCollisionsNo

stageCollisionsNo()

Disables the built-in object named plane’s MeshCollider. It does not hide the stage, disable terrain colliders or remove model colliders. Use only when another intended ground surface exists if actors need support.

Unity target: stageCollisionsNo. JavaScript lines: 7183. Status: source-traced; runtime not verified in this audit.

stageCollisionsYes

stageCollisionsYes()

Enables the built-in object named plane’s MeshCollider. It does not show the stage or create a missing collider. This reverses stageCollisionsNo().

Unity target: stageCollisionsYes. JavaScript lines: 7179. Status: source-traced; runtime not verified in this audit.

stageFriction

stageFriction(f)

stageFriction(f) assigns the same numeric value to static and dynamic friction on the built-in plane MeshCollider material. Typical values are 0 to 1; the wrapper performs no validation. This does not change terrain splats or the friction of other colliders.

Unity target: stageFrictionF. JavaScript lines: 5715. Status: source-traced; runtime not verified in this audit.

stageHeight

stageHeight(n)

Moves the built-in plane to Unity world position (0,height,0), also resetting its X and Z to zero. The receiver parses a string and the wrapper forwards its argument unchanged; use stageHeight("0") for the standard ground height. It does not sculpt a Terrain, move a movie set or reground existing props.

Unity target: stageHeight. JavaScript lines: 7187. Status: source-traced; runtime not verified in this audit.

startAutoPlayer

startAutoPlayer(goname,bodypart)

Starts the prepared dancer's existing automatic player for a named body part. Requires that actor's dancer implementation and valid body-part names. It is not navigation/pathfinding for arbitrary scenery or an LLM agent.

Unity target: startAutoPlayer. JavaScript lines: 7082. Status: source-traced; runtime not verified in this audit.

startGizmos

startGizmos()

Enables the existing RTG plugin and calls holdAll(), affecting scene physics while gizmos are active. Requires the configured RTG object. This is not a harmless UI-only toggle.

Unity target: startGizmos. JavaScript lines: 6407. Status: source-traced; runtime not verified in this audit.

object.startJets

object.startJets()

For a jetpack prefab, object.startJets() plays the existing left/right rocket ParticleSystems. This method alone does not assign propulsion force; force configuration is separate.

Unity target: startJets. JavaScript lines: 1626. Status: source-traced; runtime not verified in this audit.

startRecording / checkAudioMaster

startRecording()
checkAudioMaster()

Legacy rig/animation recording, not the AudioLab microphone API: Unity creates animation track0 and starts recording track 0. The JavaScript wrapper also manages legacy recording UI/audio state. It requires that recording setup and is not a drop-in game sound recorder.

Unity target: startRecording. JavaScript lines: 6240, 6264. Status: source-traced; runtime not verified in this audit.

stopAutoPlayer

stopAutoPlayer(goname)

Stops the prepared dancer's existing automatic player through endAutoPlayer. It does not stop the Workshop team or unload the actor.

Unity target: stopAutoPlayer. JavaScript lines: 7088. Status: source-traced; runtime not verified in this audit.

stopGizmos

stopGizmos()

Disables the existing RTG plugin and calls releaseAll(). This changes simulation state as well as editor handles; do not assume it restores each object's earlier individual frozen state.

Unity target: stopGizmos. JavaScript lines: 6412. Status: source-traced; runtime not verified in this audit.

object.stopJets

object.stopJets()

For a jetpack prefab, object.stopJets() clears force slot 0 on its physics component and on its top parent when present, then stops both rocket ParticleSystems. It changes propulsion as well as visuals.

Unity target: stopJets. JavaScript lines: 1631. Status: source-traced; runtime not verified in this audit.

stopRecording

stopRecording()

Stops legacy animation recording, stops its microphone recording and transfers serialized track 0 to JavaScript. It also clears rerecording. This is not the modern AudioLab save-to-library flow.

Unity target: stopRecording. JavaScript lines: 6310. Status: source-traced; runtime not verified in this audit.

testAudioMorphsOn

testAudioMorphsOn()

testAudioMorphsOn() sets Unity's testingaudiomorphs flag true. It is a legacy diagnostic toggle, not a sound playback API or a microphone permission request.

Unity target: testingAudioOn. JavaScript lines: 8239. Status: source-traced; runtime not verified in this audit.

unloadAsset

unloadAsset(assetname)

Unloads a named legacy AssetDictionary bundle with Unload(false), so already instantiated assets are retained. It marks the Unity dictionary entry unloaded and updates PlayerPrefs. It does not remove a named CS actor or unload a modern movie set.

Unity target: unloadAsset. JavaScript lines: 6679. Status: source-traced; runtime not verified in this audit.

object.unsetLoadObject

object.unsetLoadObject(loadobjectname)

For a cannon, object.unsetLoadObject(name) re-enables the same two collision pairs disabled by setLoadObject. The receiver still assigns loadObject to that named object; it does not clear the reference or delete/unparent the projectile.

Unity target: unsetLoadObject. JavaScript lines: 2103. Status: source-traced; runtime not verified in this audit.

UpdateCanvasTexture

UpdateCanvasTexture()

UpdateCanvasTexture() sends a request to the hard-coded CanvasCube object and its GetCanvasTexture component to refresh the existing canvas texture ID. It takes no URL or object argument and is internal/demo canvas plumbing.

Unity target: updateCanvasTexture. JavaScript lines: 9090. Status: source-traced; runtime not verified in this audit.

updateParticles

updateParticles()

Performs a single shared-particle update on the selected ParticleSystem: reads live particles, copies XYZ triples from SharedFloats into their positions or velocities depending on mode, then writes them back. Requires initialization and enough buffer values; it does not spawn or style a particle effect.

Unity target: updateParticles. JavaScript lines: 9126. Status: source-traced; runtime not verified in this audit.

updateParticlesOff

updateParticlesOff(json)

Clears the Unity ParticlesOn flag so the automatic shared-particle updater is disabled. It does not destroy the system or necessarily stop its own particle simulation. The JavaScript argument is unused.

Unity target: updateParticlesOff. JavaScript lines: 9110. Status: source-traced; runtime not verified in this audit.

updateParticlesOn

updateParticlesOn(json)

Sets the Unity ParticlesOn flag so the existing automatic shared-particle updater is enabled. Initialize the target and its shared buffer first. The JavaScript argument is unused; no exact update frequency is promised by this setter.

Unity target: updateParticlesOn. JavaScript lines: 9105. Status: source-traced; runtime not verified in this audit.

updateSpeechBubble

updateSpeechBubble(who,text,time)

updateSpeechBubble(who,text,time) changes the previously stored bubble for who. The bubble must already exist. Unlike creation, this wrapper uses commas as separators: text cannot contain commas. It does not create a missing bubble.

Unity target: updateSpeechBubble. JavaScript lines: 8273. Status: source-traced; runtime not verified in this audit.

yesCollisions

yesCollisions(goname)

Changes the named root Collider back to a non-trigger (isTrigger=false). It does not add missing colliders, enable a disabled collider or recursively configure a rig.

Unity target: yesCollisions. JavaScript lines: 4221, 8031. Status: source-traced; runtime not verified in this audit.

Known limitations — do not assume these work

hideBadge

hideBadge(id)

Warning: hideBadge(id) ignores id and always sends goal_speedrun. It cannot reliably hide an arbitrary badge by name in this wrapper revision.

Unity target: HideBadge. JavaScript lines: 5803. Status: known-limitation; runtime not verified in this audit.

showBadge

showBadge()

Warning: showBadge() is a hard-coded demonstration: it displays the goal_combo badge with Combo! and Multiplier: 6x for three seconds. It has no configuration argument. Build normal game UI in the responsive HTML control panel instead of treating this demo as a general badge creator.

Unity target: ShowBadge. JavaScript lines: 5798. Status: known-limitation; runtime not verified in this audit.

setConservationOff

setConservationOff()

Warning: setConservationOff() declares no argument but uses goname from outer scope. The receiver needs an object name to clear physics.conservation; the wrapper is not a reliable named-object command as written.

Unity target: conservationOff. JavaScript lines: 8061. Status: known-limitation; runtime not verified in this audit.

getBonePosition

getBonePosition(bonename)

Warning: getBonePosition(bonename) sends goname instead of its argument. The Unity receiver expects three comma-separated fields (object name, bone name, destination variable). The wrapper and receiver do not agree; do not use this as a working bone query. Use the documented model/rig inspection APIs where supported.

Unity target: getBonePosition. JavaScript lines: 7955. Status: known-limitation; runtime not verified in this audit.

setDrag

setDrag(goname, f)

Warning: setDrag(goname,f) currently sets angularDamping, just like setAngularDrag. It does not set linear damping despite its name. Do not describe it as linear drag or use it to fix linear motion.

Unity target: jsetDrag. JavaScript lines: 6967. Status: known-limitation; runtime not verified in this audit.

resetTargetRotations

resetTargetRotations(who)

Warning: the JavaScript wrapper sends an object-name string, but the selected cs receiver takes a GameObject parameter. It is not a compatible browser bridge as written. Do not use it as a reliable pose reset.

Unity target: resetTargetRotations. JavaScript lines: 8394. Status: known-limitation; runtime not verified in this audit.

sendCollisionsOff

sendCollisionsOff(goname)

Warning: the selected receiver broadcasts sendCollisionsOn, even for sendCollisionsOff. Do not claim this command stops collision reports in this revision. Disabling a collision watch and changing physical collisions are different operations.

Unity target: sendCollisionsOff. JavaScript lines: 4262. Status: known-limitation; runtime not verified in this audit.

stageCollide

stageCollide(b)

Warning: stageCollide(b) attempts to convert booleans using comparison rather than assignment, so the conversion does not occur. Unity expects a string boolean. Prefer stageCollisionsYes() and stageCollisionsNo() to enable/disable the built-in plane MeshCollider. This is separate from stage visibility.

Unity target: stageCollide. JavaScript lines: 7175. Status: known-limitation; runtime not verified in this audit.

updateGravity

updateGravity(s)

Warning: despite its name, the selected receiver loads a Unity scene using the supplied string and unloads all asset bundles with assets destroyed. It does not change gravity. Do not use this command to tune game physics.

Unity target: updateGravity. JavaScript lines: 9152. Status: known-limitation; runtime not verified in this audit.

Unresolved legacy routes — not approved for new games

CCDdragitOff

CCDdragitOff(goname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: CCDdragitOff. JavaScript lines: 6402. Status: unresolved-receiver; runtime not verified in this audit.

CCDdragitOn

CCDdragitOn(goname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: CCDdragitOn. JavaScript lines: 6397. Status: unresolved-receiver; runtime not verified in this audit.

object.electrify

object.electrify(type)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: Electrify. JavaScript lines: 1425, 1535, 1564, 1593. Status: unresolved-receiver; runtime not verified in this audit.

object.gravitize / gravitize

object.gravitize(name)
object.gravitize(type)
gravitize(name)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: Gravitize. JavaScript lines: 1429, 1539, 1568, 1597, 6051. Status: unresolved-receiver; runtime not verified in this audit.

LoadAndScrollImageOld

LoadAndScrollImageOld(url)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: LoadAndScrollImage. JavaScript lines: 9219. Status: unresolved-receiver; runtime not verified in this audit.

addHandles

addHandles(goname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: addHandles. JavaScript lines: 7117. Status: unresolved-receiver; runtime not verified in this audit.

changePhysicsMaterial

changePhysicsMaterial(goname,materialname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: changePhysicsMaterial. JavaScript lines: 8116. Status: unresolved-receiver; runtime not verified in this audit.

clearStage

clearStage()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: clearStage. JavaScript lines: 7153. Status: unresolved-receiver; runtime not verified in this audit.

deleteAsset

deleteAsset(assetName)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: deleteAsset. JavaScript lines: 8069. Status: unresolved-receiver; runtime not verified in this audit.

getGravity

getGravity()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: getGravity. JavaScript lines: 8159. Status: unresolved-receiver; runtime not verified in this audit.

hideTerrain

hideTerrain()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: hideTerrain. JavaScript lines: 5707. Status: unresolved-receiver; runtime not verified in this audit.

animationToString

animationToString()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jAnimationToString. JavaScript lines: 7790. Status: unresolved-receiver; runtime not verified in this audit.

setJoint

setJoint(object1,jointdata)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jChangeJoint. JavaScript lines: 5283. Status: unresolved-receiver; runtime not verified in this audit.

setSkin

setSkin(who,which)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jChangeSkin. JavaScript lines: 7798. Status: unresolved-receiver; runtime not verified in this audit.

followPath

followPath(who,which)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jFollowPath. JavaScript lines: 7812. Status: unresolved-receiver; runtime not verified in this audit.

object.lockAxes

object.lockAxes(name)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jLockAxes. JavaScript lines: 5237. Status: unresolved-receiver; runtime not verified in this audit.

setAutoplayermove

setAutoplayermove(goname, b)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jsetAutoplayermove. JavaScript lines: 7093. Status: unresolved-receiver; runtime not verified in this audit.

setDragitold

setDragitold(goname, b)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: jsetDragitold. JavaScript lines: 6985. Status: unresolved-receiver; runtime not verified in this audit.

loadAsset

loadAsset(bundlename,assetName)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: loadAsset. JavaScript lines: 8065. Status: unresolved-receiver; runtime not verified in this audit.

moveCube

moveCube()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: moveCube. JavaScript lines: 7776. Status: unresolved-receiver; runtime not verified in this audit.

trianglesToUnity

trianglesToUnity()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: receiveTriangles. JavaScript lines: 4045. Status: unresolved-receiver; runtime not verified in this audit.

removeHandles

removeHandles(goname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: removeHandles. JavaScript lines: 7123. Status: unresolved-receiver; runtime not verified in this audit.

restoreStage

restoreStage()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: restoreStage. JavaScript lines: 7159. Status: unresolved-receiver; runtime not verified in this audit.

setVertices

setVertices(name)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: setVertices. JavaScript lines: 6099. Status: unresolved-receiver; runtime not verified in this audit.

showTerrain

showTerrain()

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: showTerrain. JavaScript lines: 5711. Status: unresolved-receiver; runtime not verified in this audit.

object.smokeOff

object.smokeOff(speed)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: smokeOff. JavaScript lines: 2411. Status: unresolved-receiver; runtime not verified in this audit.

object.smokeOn

object.smokeOn(speed)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: smokeOn. JavaScript lines: 2408. Status: unresolved-receiver; runtime not verified in this audit.

unFollowPath

unFollowPath(who,which)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: unFollowPath. JavaScript lines: 7816. Status: unresolved-receiver; runtime not verified in this audit.

unFreezeParts

unFreezeParts(goname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it.

Unity target: unFreezeParts. JavaScript lines: 8229. Status: unresolved-receiver; runtime not verified in this audit.

unParentObject

unParentObject(goname,parentname)

The JavaScript wrapper exists, but no exact matching receiver was found in the selected Assets/Scripts2024 Unity evidence for this target. This is an unresolved legacy route, not evidence of a working game capability. Do not invent its effect or use the raw SendMessage call as a workaround. A matching component/receiver and live test are required before recommending it. In particular, the source contains unParentObject with a capital P, whereas this wrapper sends unparentObject. The wrapper also unfreezes the child before sending the mismatched target.

Unity target: unparentObject. JavaScript lines: 7999. Status: unresolved-receiver; runtime not verified in this audit.

CS functions by category

Choose a task, then open its exact command documentation. This pass covers bridge-connected functions and reviewed runtime commands; browser-only JavaScript APIs remain in their original sections. These navigation summaries organize the API; they do not certify runtime behavior. Internal helpers are separated from student functions. Known limitations and unresolved receivers remain marked.

Editor Basics · Objects: Check back Weekly for new objects · Loading and Positioning Objects · Setting Position, Rotation and Scale After Loading · Position by Reference · Cameras · Gravity · Physics · Objects with Special Functions · Collisions · Joints · Simulation Controls · Scene · Visual Effects · Character Animations · Animating Objects · IK Animation · Behaviors · Chat · Visualizing Data · Working with Meshes · Text · User Interface Elements · User Experience Design: Goals, Rewards, Quizzes, Surveys · Vectors and Rotation Math · Integrate another javascript library into your project · Terrain · Water and paths · Game Play and hidden outcomes · Lighting · Image Loading and Scrolling · Internal Stock Setup Callbacks · Legacy recording and audio diagnostics

Editor Basics

Navigation only. Read exact references before using a function. Search tasks: disable dragging objects in the editor, turn off drag everything, control object dragging, Main Camera drag component, run JavaScript from the code editor, test a game after editing code, execute a command-line code string, run challenge code in the editor.

  • addHandles — Legacy wrapper for an unresolved Unity receiver; its effect is unknown and it is not verified for use. [receiver unresolved; public API status needs review] doc:cs-bridge-addHandles
  • clearCode — Resets project runtime state when code is cleared, including timers, UI, sounds, animations, joints, and—unless preserveActors is true—scene-object references. This appears to be lifecycle cleanup rather than a general student gameplay command. [operation documentation needs review; public API status needs review] Related: Simulation Controls, Scene. doc:cs-bridge-cancelLeans
  • dontDragEverything — Disables legacy object dragging by turning off the dragitold component on the Main Camera; requires that component to exist. Related: Simulation Controls. doc:cs-bridge-dontDragEverything
  • main — Top-level script entry point associated with joint-readiness and socket setup; the available evidence does not establish a student-facing operation. [public API status needs review] doc:j · api:createCar · api:loadGLB
  • removeHandles — Legacy JavaScript wrapper for `removeHandles(goname)`. Its Unity receiver was not found, so its effect is unknown and it is not verified for use. [receiver unresolved; public API status needs review] doc:cs-bridge-removeHandles
  • Run — Runs JavaScript entered in the editor, or executes a supplied command string, and records the code in run history. This is an editor execution wrapper, not a documented contract for its indirect Unity targets. [operation documentation needs review] doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans
  • setAppName — Stores a string in Unity’s legacy appname field; it does not rename or save a Workshop project. [public API status needs review] doc:cs-bridge-setAppName
  • startGizmos — Enables the configured RTG gizmo plugin and calls `holdAll()`, affecting scene physics while gizmos are active. Requires the RTG object; runtime behavior was not verified. [public API status needs review] Related: Simulation Controls. doc:cs-bridge-startGizmos
  • stopGizmos — Disables the existing RTG gizmo plugin and releases all managed objects; this also changes simulation state and does not necessarily restore each object's prior frozen state. [public API status needs review] Related: Simulation Controls. doc:cs-bridge-stopGizmos
Internal helpers — not student API recommendations
  • akepaSetup — Internal setup callback for a named stock actor; its specific behavior is not documented in the supplied evidence. No exact documentation anchor; review required.
  • csEnvironmentCommand — Internal command-transport wrapper that forwards an operation and its options; it has no separately reviewed student-facing contract. [operation documentation needs review] No exact documentation anchor; review required.
  • findObjectsInEditorToLoad — Scans challenge and editor code for `load(...)` calls, removes duplicate object references, and sends the list for loading; if none are found, it starts the run instead. [operation documentation needs review] Related: Loading and Positioning Objects. doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans
  • getCubePosition — Internal/demo readback of the position of the first registered Unity object. It assumes an object exists and does not select one by name; use the named CS object's shared position for normal gameplay. Related: Loading and Positioning Objects, Setting Position, Rotation and Scale After Loading. doc:cs-bridge-getCubePosition

Objects: Check back Weekly for new objects

Review-only category: not a student capability recommendation.

Navigation only. Read exact references before using a function. Search tasks: .

  • beachballSetup — Load and set up a beachball object at the supplied position and rotation; the available reference indicates it is associated with bounds information. [public API status needs review] Related: Loading and Positioning Objects, Objects with Special Functions. No exact documentation anchor; review required.
  • moveCube — Legacy JavaScript wrapper for an unresolved Unity receiver; its effect and runtime behavior are unknown. Do not rely on it until a matching receiver is verified. [receiver unresolved; public API status needs review] doc:cs-bridge-moveCube
  • registerPlayer — Registers the named existing dancer object for legacy multiplayer and starts periodic movement updates when its multiplayer control flag is enabled. This is not account sign-in, actor renaming, or a verified runtime contract. [operation documentation needs review; public API status needs review] Related: Scene, Game Play and hidden outcomes. doc:cs-bridge-registerPlayerName
  • show — Shows a registered scenery object by name. The available evidence is mixed, so the exact visibility behavior and accepted arguments are unclear. [public API status needs review] Related: Scene. doc:scene · doc:vd · doc:text · doc:forloop · api:setSceneVisible · doc:cs-bridge-stageCollisionsYes
Internal helpers — not student API recommendations
  • cylinderSetup — Internal setup callback for a cylinder object; it is not documented as a student-facing operation. No exact documentation anchor; review required.

Loading and Positioning Objects

Navigation only. Read exact references before using a function. Search tasks: spawn objects in a loop, load stock actors into a game scene, place a penguin or vehicle at coordinates, create physics actors from stock prefabs, download a legacy game asset bundle, load assets from an AssetDictionary path, track asset download progress, load stock CS objects versus asset bundles, load a cannon into a scene, position a cannon object, add a cannon to a game scene, import a hosted GLB model as scene scenery.

  • cloneSceneObject — Clone an existing scene object and assign the clone a name, with optional settings. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • deleteAsset — The wrapper for deleting an asset has no verified Unity receiver, so its effect is unknown. Do not rely on it or use a raw SendMessage workaround; a matching receiver and live test are needed before documenting its behavior. [receiver unresolved; public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-deleteAsset
  • load — Instantiate a supported preloaded stock actor by type and name, optionally setting its initial position and Euler rotation. Related: Objects: Check back Weekly for new objects, Setting Position, Rotation and Scale After Loading. api:load · doc:lapo · doc:alprs · doc:posbyref · doc:p · doc:spafoo · doc:ao · doc:chat · doc:gv · doc:jpb · doc:forloop · api:getSceneObject · api:jeep.setSteering · api:showAnimationExplorer · api:makeCSObject · doc:cs-bridge-addAssetDictionary · doc:cs-bridge-initializeParticleSystem · doc:cs-bridge-loadAssetBundle · doc:cs-bridge-setLoadObject · doc:cs-game-sounds
  • loadAsset — Legacy asset-loading wrapper with no matching Unity receiver identified; runtime behavior is unverified, so do not rely on it or call its raw SendMessage target as a workaround. [receiver unresolved; public API status needs review] doc:cs-bridge-loadAsset
  • loadAssetBundle — Download a legacy asset bundle using its registered AssetDictionary path and report progress and completion through JavaScript callbacks. It does not instantiate an actor or return a Promise. Related: Objects: Check back Weekly for new objects. doc:cs-bridge-loadAssetBundle
  • loadbox — Convenience wrapper that requests loading a box with the supplied name, position, and rotation; runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects, Setting Position, Rotation and Scale After Loading. No exact documentation anchor; review required.
  • loadBox — Requests loading a box object by name through the object-loading wrapper; runtime availability is not established by the reviewed evidence. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadBuilding — Load a building asset from a URL under a name, defaulting to a mesh collider; options can override the defaults. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadCabin — Requests loading a cabin by name through the object-loading wrapper; runtime availability is not verified here. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadcannon — Loads a cannon object at the supplied position and rotation using the standard object-loading function. [operation documentation needs review] No exact documentation anchor; review required.
  • loadcatapult — Requests loading the catapult object with the supplied name, position, and rotation; runtime availability is not verified here. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadGLB — Imports a hosted GLB model into the scene as measured scenery, with configurable transform and collider settings. Await the returned promise before measuring it or promoting it to a CS physics actor; importing alone does not register a named actor. Related: Objects with Special Functions, Physics. api:loadGLB
  • loadjeep — Requests loading a jeep object with the supplied name, position, and rotation; runtime availability is not confirmed by the reviewed evidence. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadJeep — Load a Jeep stock object by calling the shared object-loading function with the "jeep" type and the supplied name. Runtime availability and further behavior are not established by this wrapper. [operation documentation needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadpenguin — Request loading a penguin object with a name, position, and rotation through the general object loader. [operation documentation needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadpenguinjr — Requests loading the stock `penguinjr` object under the supplied name. Runtime availability and supported options are not established by this wrapper. [operation documentation needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadScenery — Legacy, unverified loader intended to instantiate a GameObject already included in the build by resource name. The source logs that this route does not work; use the documented movie-set/GLB API for new work. Not a URL importer. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-loadScenery
  • loadSeagull — Convenience wrapper that requests loading a seagull object by name. [operation documentation needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadSocketPlayer — Loads a player object by type and player name through the standard loading function. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadsphere — Loads a sphere object with the supplied name, position, and rotation; runtime availability is not verified here. [operation documentation needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • moveModel — Place a registered scenery root at a specified absolute world position once; preserves rotation and scale and is not intended for ongoing motion or use after promotion to a CS actor. Related: Setting Position, Rotation and Scale After Loading, Physics. api:moveModel
  • removeCar — Removes a tracked car by name, cancelling its pending work and cleaning it up; returns false if no matching entry exists. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • removeEnvironmentObject — Wrapper for requesting removal of a named environment object; runtime availability and exact behavior are unverified. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects, Scene. No exact documentation anchor; review required.
  • unloadAsset — Unloads a named legacy AssetDictionary bundle while retaining assets already instantiated from it; it does not remove a CS actor or unload a modern movie set. Student-facing availability is unclear. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-unloadAsset
  • window[name].load — Load a supported stock object into the scene under a name, optionally specifying its initial position and rotation. The load call returns undefined and does not provide a completion signal. Related: Objects: Check back Weekly for new objects, Setting Position, Rotation and Scale After Loading. doc:lapo · doc:alprs · doc:posbyref · doc:p · doc:spafoo · doc:ao · doc:chat · doc:gv · doc:jpb · doc:forloop · api:load · api:getSceneObject · api:jeep.setSteering · api:showAnimationExplorer · api:makeCSObject · doc:cs-bridge-addAssetDictionary · doc:cs-bridge-initializeParticleSystem · doc:cs-bridge-loadAssetBundle · doc:cs-bridge-setLoadObject · doc:cs-game-sounds
  • window[name].remove — Remove an object from the scene. The supplied evidence mixes several different removal operations, so the exact target and effects of this member are unclear. [public API status needs review] Related: Scene. doc:p · doc:j · doc:ve · doc:vd · doc:jpb · doc:forloop · api:actor.setConstraints · api:removeTerrain · api:removeReflectionProbe · api:setSceneVisible · api:removeSceneObject · doc:cs-bridge-noCollisions · doc:cs-bridge-stageCollisionsNo · doc:cs-bridge-unloadAsset · doc:game-sound-control
Internal helpers — not student API recommendations
  • loadAssets — Internal wrapper that registers legacy asset-bundle dictionaries, starts downloads for registered bundles, and displays loading progress; it does not instantiate objects. Not a student-facing object-loading API. [operation documentation needs review] Related: Internal Stock Setup Callbacks. doc:cs-bridge-loadAssetBundle · doc:cs-bridge-addAssetDictionary

Setting Position, Rotation and Scale After Loading

Navigation only. Read exact references before using a function. Search tasks: resize scenery to a target height, scale a model while preserving proportions, adjust a cabin or building before placement, measure model height for scene layout, set scenery object position rotation scale, rotate a cabin in a scene, change model scale in world space, place or reset scenery transforms.

  • setModelHeight — Uniformly resize registered scenery to a requested world-space bounding-box height while retaining its proportions; the operation does not reposition or re-ground the model. Related: Loading and Positioning Objects. api:setModelHeight
  • setSceneObject — Set selected position, rotation, and/or scale fields on an existing scenery root. Await the returned promise; the operation does not ground the object or resolve overlaps. Related: Loading and Positioning Objects, Scene. api:setSceneObject
  • window[name].setSize — For an atoms prefab, sets the local scale of every Transform in its hierarchy; nested scales compound. This is not a generic actor scale setter. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-setSize

Position by Reference

Navigation only. Read exact references before using a function. Search tasks: attach an object to another object, parent-child object hierarchy, freeze physics when attaching objects, position objects relative to a reference.

  • parentObject — Parent an existing CS object to another while preserving its world position; the child is frozen first, which changes its physics participation. This is not a passive attachment for a dynamic passenger. Related: Loading and Positioning Objects, Physics. doc:cs-bridge-parentObject
  • placeActorAtMarker — Places an already-loaded actor at a blocking marker, with optional height offset, rotation to face the marker, and stopping of linear and angular motion. Runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Loading and Positioning Objects, Physics. No exact documentation anchor; review required.

Cameras

Navigation only. Read exact references before using a function. Search tasks: switch to first-person camera in a game, set up a third-person character view, create an orbit camera view, configure a fixed camera angle, adjust camera distance and follow heading, move camera with mouse and keyboard, manually control the game camera, pan or dolly the camera, camera controls for exploring a scene, control dynamic camera zoom, change camera motion zoom behavior, camera movement in a game scene.

  • cameraMode — Switch the existing MainCamera between first-person, third-person, orbit, and fixed modes, with optional camera settings. This changes the view; it does not create a new camera. Related: Editor Basics. api:cameraMode
  • cameraReset — Resets the camera to the captured default main-camera setup; runtime availability is not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • cameraTerrain — Enable or disable terrain-aware camera behavior and set its terrain clearance; runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • captureMainCameraDefault — Caches the current main-camera settings as a default snapshot, with controls and orbit running disabled in the saved copy. Its intended audience is unclear. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • controlCamera — Enable or disable direct mouse-and-keyboard control of the camera, including camera movement and panning. doc:sc
  • dynamicZoomOff — Clear the dynamicZoom flag on the current camera motion; this does not reset camera position or disable other camera behaviors. Related: Animating Objects. doc:cs-bridge-jdynamicZoomOff
  • dynamicZoomOn — Dynamically adjusts the camera view to keep two named objects visible together. doc:sc · doc:forloop
  • getCameraMode — Read the active character camera mode, target, and actual pose; this does not create a camera. Await the returned Promise before using its readback. Related: Scene. api:getCameraMode
  • getCameraOffsets — Displays a suggested setCamera(...) statement with the current camera’s offsets from a named object; it does not return the settings. Related: Position by Reference. doc:cs-bridge-getCameraOffsets
  • getCameraSettings — Displays the camera’s current field of view, position, and rotation as a setCameraSettings(...) statement, which can be used when configuring a camera. Related: Vectors and Rotation Math. doc:cs-bridge-getCameraSettings
  • releaseCamera — Disables mouse and keyboard control of the camera after it has been enabled with controlCamera(). doc:sc
  • setCamera — Configure the world camera to track or follow a named object, with options for zoom and offset. doc:sc · doc:forloop · doc:cs-bridge-getCameraOffsets · doc:cs-bridge-setCameraSettings
  • setCameraFieldOfView — Sets the current world camera’s field of view to an integer degree value. It does not reposition or replace the camera, and another camera controller may change the field of view afterward. doc:cs-bridge-setCameraFieldOfView
  • setCameraLerp — Sets the swoop-lerp numeric setting on the existing camera controller; the value is not clamped. doc:cs-bridge-jsetSwoopLerp
  • setCameraSettings — Set the existing world camera’s field of view, position, and quaternion rotation. This is a low-level camera restoration route; coordinates are assigned directly in Unity space, and it stops the legacy camera swoop first. doc:cs-bridge-setCameraSettings · doc:cs-bridge-getCameraSettings
  • setSceneCamera — Updates the scene camera settings by combining the supplied camera values with the current camera state; the wrapper also captures the main camera default before sending the update. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.

Gravity

Navigation only. Read exact references before using a function. Search tasks: enable gravity on a Rigidbody, turn off gravity for an object, physics gravity control in a game, custom acceleration without gravity, make an object move without falling, make a physics object fall, gravity for dancer actors, Unity Rigidbody useGravity, change scene gravity, set moon or zero gravity, adjust gravity for a physics simulation, create a gravity control for a game.

  • getGravity — A legacy gravity-related wrapper whose receiver is unresolved; its effect and runtime behavior are not verified, so do not rely on it or call the underlying Unity message directly. [receiver unresolved; public API status needs review] doc:cs-bridge-getGravity
  • gravitize — Legacy wrapper routed to a Unity target named Gravitize, but the matching receiver is unresolved. Its effect and runtime behavior are unknown; do not rely on it without confirming the receiver and testing it. [receiver unresolved; public API status needs review] doc:cs-bridge-Gravitize
  • gravityOff — Removes the added gravity force from the named object so other acceleration or motion behavior can be used without gravity acting on it. Related: Physics. doc:p
  • gravityOn — Enables Rigidbody gravity on an existing named object; prepared dancer actors also have gravity enabled on their child bodies. Requires a Rigidbody and does not change global gravity or CS acceleration. Related: Physics. doc:cs-bridge-gravityOn
  • setGravity — Sets gravity for every object in the scene, using a named setting such as earth, moon, or zero gravity, or a numeric value. doc:g · doc:ui
  • this.gravityOff — Turns gravity off for the object the function is called on. The documentation shows it being used to remove gravity from an object in a physics setup; runtime availability is not verified here. [operation documentation needs review] Related: Physics. doc:p
  • this.gravityOn — Enables Rigidbody gravity on the named object; for prepared dancer actors, also enables gravity on their child bodies. Requires an existing Rigidbody and does not change global gravity or CS acceleration. [operation documentation needs review] Related: Physics. doc:cs-bridge-gravityOn
  • window[name].gravitize — Legacy wrapper intended to route a gravitize request, but its effect is unknown because no matching Unity receiver was found. Do not rely on it or call the raw SendMessage target as a workaround. [receiver unresolved; public API status needs review] doc:cs-bridge-Gravitize

Physics

Navigation only. Read exact references before using a function. Search tasks: compare static and dynamic friction, set object velocity in a physics game, make an actor kinematic, change Rigidbody physics mode, freeze an actor’s root body, kinematic versus dynamic Rigidbody, freeze an actor’s Z position, allow an actor to move freely, Rigidbody position constraints, configure actor physics, make a ball bounce, change collider bounciness.

  • actor.freeze — Make an existing actor’s root Rigidbody kinematic for an intentional change to its physics behavior. This does not freeze articulated child bodies or serve as a loading, placement, or seating helper. api:actor.freeze
  • actor.setConstraints — Set a loaded actor’s root Rigidbody constraints to freeze Z position or remove constraints, subject to the documented restrictions. This changes live physics state; it does not move the actor. api:actor.setConstraints
  • actor.setElasticity — Set the bounciness of a loaded actor’s root collider; dancer actors also have bounciness applied to active child colliders. Related: Collisions. api:actor.setElasticity
  • actor.setFriction — Set the root collider’s static and dynamic friction, and also active child-collider friction for dancer actors. Requires an existing collider; changes are applied asynchronously and are not awaited. Related: Collisions. api:actor.setFriction
  • actor.unfreeze — Restore an existing actor root Rigidbody to dynamic physics so it can respond to forces and collisions. It does not clear constraints or joints, restore prior settings, or recursively unfreeze child bodies. Related: Gravity, Collisions. api:actor.unfreeze
  • cameraRaycast — Cast a ray from the center of MainCamera in physics or mesh mode and await hit details, optionally ignoring objects such as the shooter. Related: Cameras, Collisions. api:cameraRaycast
  • CCDdragitOff — Legacy wrapper for an unresolved Unity target; its effect and runtime behavior are unverified. Do not recommend it or use a raw SendMessage workaround without confirming a matching receiver and live behavior. [receiver unresolved; public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-CCDdragitOff
  • changePhysicsMaterial — A legacy wrapper named for changing an object's physics material; its Unity receiver is unresolved, so its effect and runtime behavior are unverified. [receiver unresolved; public API status needs review] Related: Collisions. doc:cs-bridge-changePhysicsMaterial
  • characterController — Enable or disable a dynamic actor’s capsule movement motor, configuring movement options such as walking, running, jumping, and keyboard input. Await completion before issuing dependent commands. Related: Gravity, Collisions. api:characterController
  • characterInput — Send movement-axis input and an optional jump request to a loaded character motor; custom controls can disable keyboard input and should send zero input when released. Related: Character Animations, Objects with Special Functions. api:characterInput
  • constrain — Applies one of a fixed set of Rigidbody position-and-rotation constraint presets; unrecognized values and the documented CCD mode leave constraints unchanged. Related: Joints. doc:cs-bridge-jconstrain · doc:cs-bridge-jsetSphereControlAxis
  • createCar — Create a version-pinned four-wheel car assembly with configurable controls and suspension. It loads the specified models and creates the vehicle’s joints; compatible geometry and the documented prototype schema are required. Related: Joints, Loading and Positioning Objects. api:createCar
  • explode — Apply a radial force at a position to push objects within a specified radius, with an optional vertical adjustment to the blast center. Related: Objects with Special Functions, Collisions. doc:ve
  • freezeParts — Make every Rigidbody in a named object’s active hierarchy, including the root when present, kinematic. This changes the physics of the whole character or mechanism; do not use it to seat a dynamic passenger, as freezing a rig can stop its movement or animation. Related: Gravity. doc:cs-bridge-freezeParts
  • getCharacterState — Read a uniquely named character’s actual enabled and grounded state, position, velocity, and motor settings. Await the returned Promise before using the readback in dependent commands. Related: Character Animations, Loading and Positioning Objects. api:getCharacterState
  • getElasticity — Writes the named object's collider bounciness (elasticity) to the Unity console; it does not return the value or update a JavaScript variable. Related: Joints, Collisions. doc:cs-bridge-jgetBounciness
  • getFriction — Writes the named collider’s static and dynamic friction values to the Unity console; it does not return them. Related: Collisions. doc:cs-bridge-jgetFriction
  • handGrabAttachToCenterOff — For a character with the prepared grabbing implementation, turns off attaching grabbed objects to the character’s center. Related: Objects with Special Functions. doc:cs-bridge-handGrabAttachToCenterOff
  • holdAll — Sets every object to fixed so it stops moving; use it to freeze the scene’s physics objects. Related: Simulation Controls. doc:simc · doc:cs-bridge-startGizmos
  • jeep.setSpeed — Set the target angular velocity for the four wheel joints of a loaded stock CS Jeep to drive or reverse it; this does not directly move the Jeep or guarantee an immediate stop. Related: Objects: Check back Weekly for new objects, Objects with Special Functions. api:jeep.setSpeed
  • jeep.setSteering — Control the loaded stock Jeep’s front steering joints by setting a target steering angle in degrees, clamped by Unity to -60 through 60. Call after the Jeep has loaded; this is a physics-actor control, not a transform rotation. Related: Objects with Special Functions. api:jeep.setSteering
  • jeep.steer — Set the loaded stock Jeep’s front-wheel steering target in degrees; the Unity receiver clamps the angle to −60..60. Call it after the Jeep and its joints have initialized. Related: Objects with Special Functions. api:jeep.steer
  • logPhysicsSettings — Log a named object's child collider settings and root Rigidbody settings to the Unity console for physics debugging; this is diagnostic output, not a way to modify those components. [public API status needs review] doc:cs-bridge-logPhysicsSettings
  • maintainGroundOrientation — Set an existing physics-enabled actor’s ground-orientation behavior on or off. Requires the actor to have a CS physics component; it does not change terrain height or add physics to static scenery. Related: Terrain. doc:cs-bridge-maintainGroundOrientation
  • maintainSpeed — Enable or disable ongoing forward-speed maintenance for an actor; positive speed sets the target, while zero or a negative value disables it. Adjustment is gated by a downward raycast near the transform origin, so it may not suit tall actors. Related: Gravity. doc:cs-bridge-maintainSpeed · doc:cs-bridge-maintainYRotationSpeed
  • maintainYRotationSpeed — Sets an object's maintained Y-axis rotation target: positive speed enables adjustment toward the target angular velocity, while zero or negative speed disables it. Adjustment is gated by a downward-ray distance below 0.2 from the transform origin; runtime behavior is not verified. Related: Gravity. doc:cs-bridge-maintainYRotationSpeed
  • makeCSObject — Promote a previously imported GLB scene root into a registered CS physics actor, preserving its visible pose and geometry. Await completion before using actor physics properties; only box colliders are supported by the wrapper. Related: Loading and Positioning Objects, Collisions. api:makeCSObject
  • measureGroundDistanceOff — Stops periodic ground-distance measurement for an actor using its existing CS physics component; it does not change terrain or colliders. Related: Gravity. doc:cs-bridge-measureGroundDistanceOff
  • measureGroundDistanceOn — Enables periodic ground-distance measurement on an actor’s existing CS physics component. Successful downward raycasts update `object.groundDistance`; misses leave the previous value unchanged. It does not return an immediate measurement or add a physics component to scenery models. Related: Terrain. doc:cs-bridge-measureGroundDistanceOn
  • meshRaycast — Raycast against visible mesh triangles to find the nearest hit without adding colliders; supports targets, ignores, and layer masks when configured. Related: Collisions. api:meshRaycast
  • physicsRaycast — Cast a ray through the physics scene and await the nearest collider hit or a miss; use hit details such as the point, normal, and distance for targeting or interaction logic. Related: Collisions. api:physicsRaycast
  • physicsSettings — Selects a global macro or micro physics preset, changing simulation thresholds, solver iterations, and contact offset. The micro preset may use more CPU and is not automatically better for ordinary game objects. Related: Gravity, Simulation Controls. doc:cs-bridge-physicsSettings
  • releaseAll — Releases all objects from their fixed state so they can move again. The evidence notes that this does not necessarily restore each object's earlier frozen state. Related: Simulation Controls. doc:simc · doc:cs-bridge-stopGizmos
  • setAngularDrag — Set angular damping on the named object's root Rigidbody. This does not set linear drag or affect child bodies; use an existing object name and a nonnegative damping value. Related: Joints. doc:cs-bridge-jsetAngularDrag · doc:cs-bridge-jsetDrag
  • setCenterOfMass — Resets the root Rigidbody’s center of mass to Unity’s automatic calculation from its colliders; it does not set a custom center or change mass. Related: Gravity. doc:cs-bridge-setCenterOfMass
  • setConservationOff — Intended to clear an object's physics conservation setting, but the wrapper does not accept the required object name and is documented as unreliable; runtime behavior is unverified. [known limitation; public API status needs review] Related: Simulation Controls. doc:cs-bridge-conservationOff
  • setConservationOn — Enables the legacy custom physics conservation flag on a named actor. doc:cs-bridge-conservationOn
  • setDragit — Enable or disable drag and continuous collision detection (CCD) behavior on the prepared dancer. Related: Joints. doc:cs-bridge-jsetDragit
  • setDragK1 — Sets the numeric dragK1 tuning parameter on an existing prepared dancer rig; it does not create a drag controller or move the model. [public API status needs review] Related: Joints. doc:cs-bridge-jsetDragK1
  • setDragK2 — Set the numeric dragK2 tuning parameter on an existing prepared dancer; this does not create a drag controller or move the model. [public API status needs review] Related: Character Animations. doc:cs-bridge-jsetDragK2
  • setGroundDistanceInterval — Set the positive, scaled-seconds interval for ground-distance checks on a named physics component. Successful later raycasts update the object's groundDistance; this does not return ground height immediately. Related: Position by Reference. doc:cs-bridge-setGroundDistanceInterval
  • setHandGrab — Enable or disable a dancer’s hand grabbing and the associated weight setup used for throwing. Related: Objects with Special Functions. doc:cs-bridge-jsetHandgrab
  • setHandGrabThrowBoost — Set the numeric throw boost on grab components already present on a named prepared character; this does not create a throw controller or apply an immediate impulse. [public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-setHandGrabThrowBoost
  • setMaxDragForce — Sets the maximum drag-force limit on a prepared dancer that has the required drag behavior; it does not apply force to an arbitrary Rigidbody. Related: Joints. doc:cs-bridge-jsetMaxDragForce
  • setModelPartRigidbody — Assign an imported GLB model part an independent static, kinematic, or dynamic Rigidbody; optionally give it a unique name for use when creating joints. Related: Joints, Working with Meshes. api:setModelPartRigidbody
  • setSceneRigidbody — Configure an imported GLB scene item’s root Rigidbody as static, kinematic, or dynamic scenery physics; dynamic mode requires solid primitive, convex, or compound collision. Related: Scene. api:setSceneRigidbody
  • setWeightsMass — Set the mass of all four prepared hand/foot weight Rigidbodies on an actor. This does not change the root actor’s mass and can significantly affect rig behavior; do not use it just to place a passenger. Related: Joints. doc:cs-bridge-jsetWeightsMass
  • setWind — Sets the scene's wind value through the environment command; the reviewed contract does not establish its runtime behavior or availability. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • stageBounciness — Sets the built-in plane MeshCollider material's bounciness from 0 to 1; it does not change terrain or other colliders. The receiver expects a numeric string, for example stageBounciness("0.2"). Source-traced; runtime not verified. Related: Collisions. doc:cs-bridge-stageBounciness
  • stageFriction — Set the built-in plane collider's static and dynamic friction to the same numeric value; this does not affect terrain splats or other colliders. Related: Collisions. doc:cs-bridge-stageFrictionF
  • this.freeze — Makes an actor's root physics body kinematic so physics will no longer move it. It does not recursively freeze child bodies or preserve the previous physics settings for restoration. Related: Joints. doc:p · doc:j · api:actor.freeze · api:actor.unfreeze · api:actor.setConstraints · api:jeep.setSteering · api:jeep.steer · api:placeOnTerrain · doc:cs-bridge-parentObject
  • this.setAngularVelocity — Set an object's angular velocity components to control how it rotates under physics simulation. Related: Vectors and Rotation Math. doc:p
  • this.setConstraints — Set a loaded actor’s root Rigidbody constraint mode to freeze movement on the Z axis or clear its constraints. Only "z" and "none" are supported; clearing constraints also replaces any existing rotation constraints. doc:p · api:actor.setConstraints
  • this.setElasticity — Set the bounciness of an existing actor’s collider. The actor must be loaded and have a root Collider; support for updating child colliders varies by actor. Related: Joints. doc:p · api:actor.setElasticity
  • this.setFriction — Set an object's friction value, documented as a number from 0 to 1, to adjust how it responds to motion and contact in physics simulations. doc:p · doc:forloop · api:actor.setFriction
  • this.setVelocity — Set an object's linear velocity to the supplied x, y, and z values, affecting how it moves under physics. doc:p
  • this.unfreeze — Makes an actor dynamic so physics can move it. It uses the actor’s root dynamic defaults; it does not restore a previous physics configuration. Related: Joints. doc:p · doc:j · api:actor.freeze · api:actor.unfreeze
  • unFreezeParts — Legacy wrapper apparently intended to unfreeze parts, but its Unity receiver is unresolved and runtime behavior is unverified. Do not recommend it as a working API. [receiver unresolved; public API status needs review] doc:cs-bridge-unFreezeParts
  • unParentObject — Legacy wrapper intended to remove a parent relationship between named objects, but its Unity receiver is unresolved and runtime behavior is unverified. Do not rely on it as a working API. [receiver unresolved; public API status needs review] Related: Joints. doc:cs-bridge-unparentObject
  • window[name].getAtomVelocityData — For an atoms object, asynchronously populates `atomvelocitydata` with comma-separated Rigidbody velocity components in Unity coordinates; the call does not return the data synchronously. [public API status needs review] Related: Visualizing Data. doc:cs-bridge-getAtomVelocityData
  • window[name].pendulumPostCollide — Controls whether the pendulum post collides with other objects. The documentation also lists a counterpart that disables post collisions. Related: Joints. doc:spafoo
  • window[name].raycast — On a loaded CS actor, request a physics line-of-sight check for active objects matching a name; read the distance-sorted results later from `object.raycasthit`, not as a synchronous return value. Related: Collisions. doc:cs-bridge-Raycast · doc:cs-bridge-maintainSpeed
  • window[name].release — The available evidence places this wrapper in physics-related object controls, but does not establish what `release(temp)` does or which objects it affects. [public API status needs review] doc:p · api:createCar · api:characterInput · api:cameraMode · api:weaponIK · api:getWeaponIK · api:moveWeapon · api:rotateWeapon · api:aimWeapon · api:aimWeaponWithCamera · api:weaponSupportHand · api:weaponIKWeight · doc:cs-bridge-freezeParts · doc:cs-game-sounds
  • window[name].reset — Intended to reset an object's pose and motion state, but the JavaScript wrapper passes an object-name string to a receiver that expects a GameObject. Do not rely on it as a working pose reset; use documented actor transforms for placement or physics controls for motion. [public API status needs review] Related: Setting Position, Rotation and Scale After Loading. doc:p · doc:j · doc:vd · doc:forloop · api:load · api:groundModel · api:createCar · api:setModelHeight · api:moveModel · api:setSceneObject · doc:cs-bridge-jdynamicZoomOff · doc:cs-bridge-resetTargetRotations
  • window[name].setForces — Sets a force-related amount on a named actor; the available evidence does not clarify its effect or valid values. [public API status needs review] Related: Gravity. No exact documentation anchor; review required.
  • window[name].setMass — Set the mass of every child Rigidbody in an atoms prefab. This Atomsscript-specific operation is not the general actor mass property; use a positive mass. Runtime behavior has not been verified. Related: Objects with Special Functions. doc:cs-bridge-setMass
  • window[name].setTemperature — For an atoms prefab, randomizes atom XY velocities from a nonnegative temperature-like input and stores a velocity magnitude in physics.temp. Requires atoms and positive mass; this is an approximation, not a validated temperature in physical units. doc:cs-bridge-setTemperature
  • window[name].setVelocity — Set an object's velocity vector to control its motion in a physics simulation. Related: Gravity. doc:p
  • window[name].setWeight — Set the weight of a loaded pendulum actor, as in the documented pendulum example. Related: Objects with Special Functions. doc:spafoo

Objects with Special Functions

Navigation only. Read exact references before using a function. Search tasks: build a projectile-launching game, prevent a character from grabbing an object, exclude objects from character interaction, configure grab behavior in a game, object pickup rules, add speech bubble manager, set up character speech bubbles, display dialogue above characters, Unity speech bubble setup, drag objects in a scene, enable scene object dragging, interactive object manipulation.

  • addDontGrab — Exclude a named object from being grabbed by a prepared character whose grab components support this receiver; it does not add grabbing behavior to arbitrary objects. Related: Behaviors. doc:cs-bridge-addDontGrab
  • addSpeechBubbleManager — Creates the SpeechBubble Manager needed before using legacy Unity speech-bubble calls when no manager exists. Avoid creating duplicate managers. Related: Character Animations, User Interface Elements. doc:cs-bridge-addSpeechBubbleManager
  • CCDdragitOn — Legacy JavaScript wrapper with an unresolved Unity receiver. Its effect is unknown and runtime behavior is unverified; do not rely on it or use a raw SendMessage workaround. [receiver unresolved; public API status needs review] doc:cs-bridge-CCDdragitOn
  • dragEverything — Enables the legacy dragitold component on Main Camera so scene objects can be dragged; the component must already exist. Related: Editor Basics, Scene. doc:cs-bridge-jsetdragEverything · doc:cs-bridge-dontDragEverything
  • jeep.getSpeed — Request the loaded stock Jeep’s stored wheel-drive command. The returned callback value may be undefined or stale; it is not a measurement of the Jeep’s actual speed. Related: Physics. api:jeep.getSpeed
  • releaseWeapon — Detach a held prop at its current pose, restore its prior ownership and physics settings, and give it the character’s linear velocity. Related: Physics. api:releaseWeapon
  • removeDontGrab — Remove an object from a prepared character’s grab-exclusion list, allowing it to be grabbed when the required prefab grab components are present. Related: Objects: Check back Weekly for new objects. doc:cs-bridge-removeDontGrab
  • setEyeson — Sets the prepared dancer’s eyeson boolean; it requires that dancer’s existing eye behavior and is not a general eye-animation command for arbitrary models. Related: Character Animations. doc:cs-bridge-jsetEyeson
  • setFootBalance — Hides the prepared hand and foot weight objects by disabling their MeshRenderers. Despite the name and signature, this routed wrapper does not balance feet; do not use it for foot balancing. [public API status needs review] Related: Character Animations. doc:cs-bridge-hideWeights
  • setHeadache — Set the prepared dancer’s numeric headache value; this function does not itself define a loss condition, scoring rule, or general damage system. doc:cs-bridge-jsetHeadache
  • setSkin — Legacy wrapper intended to request a skin change, but its Unity receiver is unresolved; its effect and availability are unverified. [receiver unresolved; public API status needs review] Related: Character Animations. doc:cs-bridge-jChangeSkin
  • setSphereControlAxis — Set the sphere control axis on a prepared dancer rig, using only axis choices demonstrated for that rig; this does not configure a generic sphere collider. Related: Physics. doc:cs-bridge-jsetSphereControlAxis
  • setThrowing — Enable or disable the throwing behavior on a prepared dancer that has the required grab/throw rig; this does not make arbitrary GLB objects throwable. Related: Physics. doc:cs-bridge-jsetThrowing
  • setThrust — Toggle the thrust behavior on a prepared dancer rig using a boolean; this is not a numeric impulse or general propulsion force. [public API status needs review] Related: Character Animations. doc:cs-bridge-jsetThrust
  • wieldWeapon — Attach a single prop to a character bone, with selectable hand, grip, and axis. Requires uniquely named loaded objects and a compatible character rig; articulated weapons are rejected, and the held prop temporarily stops independent physics. Related: Character Animations, Loading and Positioning Objects. api:wieldWeapon
  • window[name].angle — Set the angle of a loaded catapult using its angle method. The evidence does not specify angle limits. Related: Objects: Check back Weekly for new objects. doc:sc · doc:spafoo · doc:j · doc:ao · api:jeep.setSteering · api:jeep.steer
  • window[name].drop — The documented pendulum method releases the pendulum; it is listed with other pendulum controls such as setting its angle, weight, and length. Runtime behavior is not verified, and the source evidence also associates this target with legacy recording setup. [public API status needs review] Related: Physics, Joints. doc:spafoo · doc:cs-bridge-startRecording
  • window[name].electrify — Legacy wrapper for an unresolved Unity receiver. Its effect is unknown, and it is not verified as a working game capability; do not recommend using it. [receiver unresolved; public API status needs review] doc:cs-bridge-Electrify
  • window[name].fire — Fires a loaded cannon, launching its loaded object; the cannon must have an object loaded first. doc:spafoo · doc:ve · doc:cs-bridge-setParticleUpdateType
  • window[name].getAnchorPosition — Asynchronously updates a loaded cannon’s anchorPosition with the cannon-specific anchor’s world position; this is not a general model-bounds query. Related: Position by Reference. doc:cs-bridge-getAnchorPosition
  • window[name].getSpeed — Request the stock Jeep’s cached wheel-drive command set through setSpeed. The callback may not have replied yet, so the result can be undefined or stale; it is not a measurement of vehicle speed. Related: Physics, User Interface Elements. doc:spafoo · api:jeep.getSpeed
  • window[name].hidePendulumPost — Hide the pendulum’s support post, changing which parts of the stock pendulum are visible in a physics scene. Related: Visual Effects. doc:spafoo
  • window[name].launch — Launches the catapult’s loaded object, supporting projects that trigger a projectile launch through a script or game event. Related: Physics. doc:spafoo · doc:ui
  • window[name].pendulumPostDontCollide — Disable collisions between the pendulum and its post using the loaded pendulum’s method. Related: Collisions. doc:spafoo
  • window[name].registerVolume — Stores a supplied string in a sensor prefab’s volumeString. Its format and use depend on the sensor implementation; this is not a general audio-volume control. [public API status needs review] Related: Collisions. doc:cs-bridge-registerVolume
  • window[name].setAngle — Sets the angle of special stock objects, including a cannon and a pendulum; the evidence also shows the cannon angle being controlled with a slider. Related: Physics. doc:spafoo
  • window[name].setGunPowder — Set the amount of gunpowder a loaded cannon uses when firing; the value controls cannon launch strength. Related: Physics. doc:spafoo
  • window[name].setLength — Set the length of a loaded pendulum, changing the pendulum setup for a physics activity. Related: Physics, Joints. doc:spafoo
  • window[name].setSpeed — Set the stock Jeep’s wheel-joint drive target. The value is a wheel-drive command, not measured speed or metres per second; actual movement depends on physics and the loaded vehicle. Related: Physics. doc:spafoo · api:jeep.setSpeed · api:jeep.getSpeed
  • window[name].setSteering — Steer the front joints of a loaded stock Jeep using an angle in degrees; Unity clamps the value to −60..60, with zero requesting straight steering. Related: Physics, Joints. doc:spafoo · api:jeep.setSteering · api:jeep.steer
  • window[name].setWeightObject — Change the pendulum’s weight object to a named stock object; the example uses `opencrate`. Related: Objects: Check back Weekly for new objects. doc:spafoo
  • window[name].showPendulumPost — Shows the pendulum’s post after the pendulum object has loaded. doc:spafoo
  • window[name].smokeOff — Legacy wrapper targeting `smokeOff`; its receiver and effect are unresolved, so no working capability can be documented or recommended. [receiver unresolved; public API status needs review] doc:cs-bridge-smokeOff
  • window[name].steer — Set the steering target of a loaded stock Jeep by calling its steering method with an angle in degrees. The receiver clamps the angle to −60 through 60; zero requests straight steering. Requires the stock Jeep and its setup to finish loading. Related: Physics, Joints. doc:spafoo · api:jeep.setSteering · api:jeep.steer
  • window[name].stopJets — Stops a jetpack prefab’s rocket particle effects and clears its propulsion force from its physics component and, when present, its top parent. Related: Physics, Visual Effects. doc:cs-bridge-stopJets
  • window[name].tension — Adjust a catapult’s spring tension to set the strength of its launch. doc:spafoo
Internal helpers — not student API recommendations
  • javascriptControlOn — Enables JavaScript control for a registered CS object by setting its control flag in the JavaScript registry and matching Unity record. This is shared-memory plumbing, not a way to add physics or register an object. doc:cs-bridge-javascriptControlOn

Collisions

Navigation only. Read exact references before using a function. Search tasks: detect when two game objects collide, run code when objects touch or separate, collision enter and exit events, trigger an interaction between game objects, make an object pass through physical barriers, change collision behavior for a named object, configure trigger-based interactions, teach collider and trigger differences, stop collision notifications for an object, collision event monitoring in a game, difference between collision reports and physical collisions, enable or disable box collider.

  • collisionWatch — Register enter and exit callbacks for collisions between two named objects, optionally specifying child objects. Related: Behaviors. doc:col · doc:forloop
  • noCollisions — Sets the named object's root Collider to a trigger, changing physical contact behavior while leaving the collider in place; child colliders are not changed and trigger events may still occur. Related: Physics. doc:cs-bridge-noCollisions
  • sendCollisionsOff — Intended to stop collision notifications for the named object, but this revision’s receiver broadcasts `sendCollisionsOn` even for this command; do not describe it as disabling collision reports. Collision monitoring is distinct from changing physical collisions. [known limitation] Related: Physics. doc:cs-bridge-sendCollisionsOff
  • sendCollisionsOn — Requests collision notifications for the named object. Collision reporting and physical collision behavior are distinct; the evidence does not establish that this command changes physical collisions. [public API status needs review] doc:cs-bridge-sendCollisionsOff
  • setBoxCollider — Enable or disable the named object's existing root BoxCollider; does not add a collider or affect child colliders. Related: Physics. doc:cs-bridge-jsetBoxCollider
  • setHeadacheThreshold — Changes the headache threshold on a dancer’s mapped head bone. Requires a prepared bone map and head collision component; it does not work on arbitrary unrigged GLBs. Related: Objects with Special Functions. doc:cs-bridge-jsetHeadacheThreshold
  • setModelPartCollider — Replace the collider profile on one inspected part of an imported GLB model. The model root collider must be none; collider regions cannot overlap configured ancestors or descendants, and physics mode is configured separately. Related: Physics, Working with Meshes. api:setModelPartCollider
  • setSceneCollider — Replace the collider on an imported GLB scenery model with a supported primitive, mesh, or compound shape; replacement may be rejected when incompatible with its physics setup. Related: Physics. api:setSceneCollider
  • setTriggerRestoreTime — Sets the trigger-restore time on existing components of a named prepared grabbing character; the effect depends on those components’ implementation and does not configure arbitrary colliders. [public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-setTriggerRestoreTime
  • stageCollide — Intended to enable or disable collision on the built-in stage plane, but its boolean conversion is known to be faulty. Prefer stageCollisionsYes() and stageCollisionsNo(); this is separate from stage visibility. [known limitation; public API status needs review] Related: Physics. doc:cs-bridge-stageCollide
  • stageCollisionsNo — Disables the MeshCollider on the built-in object named `plane`. This does not hide the stage or disable terrain or model colliders; use it only when another ground surface is intended. Related: Physics. doc:cs-bridge-stageCollisionsNo · doc:cs-bridge-stageCollisionsYes · doc:cs-bridge-stageCollide
  • stageCollisionsYes — Enables the MeshCollider on the built-in object named `plane`. This does not show the stage or create a collider if one is missing. doc:cs-bridge-stageCollisionsYes · doc:cs-bridge-stageCollide
  • window[name].setLoadObject — For a cannon, records an existing load object and ignores collisions between its collider and the cannon's gun and base BoxColliders. It does not create, load, parent, or position the object; required cannon components and the load collider must exist. Source-traced; runtime not verified. Related: Objects with Special Functions, Physics. doc:cs-bridge-setLoadObject · doc:cs-bridge-unsetLoadObject
  • window[name].unsetLoadObject — For a cannon, re-enable the collision pairs disabled by setLoadObject for the named object. This does not clear the cannon’s loadObject reference or delete or unparent the projectile. Related: Objects with Special Functions. doc:cs-bridge-unsetLoadObject
  • yesCollisions — Changes the named object's root Collider from trigger mode to a non-trigger collider; it does not add or enable colliders or configure child colliders. Related: Physics. doc:cs-bridge-yesCollisions

Joints

Navigation only. Read exact references before using a function. Search tasks: joint motor force, configure a hinge or swivel joint, joint angular limit bounce, configure joint movement limits, build a jointed physics mechanism, joint limit bounce, physics joint behavior, physics joint movement, connect physics objects with a joint, build a hinged mechanism, make a spring or shock absorber, create a motorized physics assembly.

  • buildJoints — Legacy joint wrapper that attempts to create a joint between two objects and set joint parameters. Its Unity receiver is unresolved, so runtime behavior is unverified. [operation documentation needs review; public API status needs review] Related: Physics. doc:cs-bridge-jChangeJoint
  • createJoint — Create a locked joint connecting two physics objects; adjust joint properties afterward to allow movement or build mechanisms such as hinges and motors. Related: Physics. doc:j · api:setModelPartRigidbody
  • createSceneHinge — Requests creation of a named hinge through the scene command bridge. The available evidence does not establish runtime availability or further behavior. [operation documentation needs review; public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • driveSceneHinge — Drive a named scene hinge toward a target angle, with a default speed and target mode that options can override. Runtime availability is not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • maximizeJointLimits — Set wide angular limits on every ConfigurableJoint in a named active hierarchy, allowing a prepared rig to move through a much larger range. Related: Physics. doc:cs-bridge-maximizeJointLimits
  • removeJoint — Removes a joint by its name, disconnecting the objects it connects. Joint names are formed from the connected object names, such as `box1box2`. Related: Physics. doc:j
  • setDrag — Sets a named object's angular damping. Despite its name, this currently behaves like setAngularDrag and does not set linear damping. [known limitation] Related: Physics. doc:cs-bridge-jsetDrag
  • setDragitold — Legacy joint-related wrapper with an unresolved Unity receiver; its effect is unknown and it is not verified as a working API. [receiver unresolved; public API status needs review] doc:cs-bridge-jsetDragitold
  • setDriveDampers — Set the position damping on angular X and YZ drives of ConfigurableJoints in a named object's active hierarchy; does not affect linear drives or create joints. Related: Physics. doc:cs-bridge-jsetDriveDampers
  • setDriveSprings — Set the angular X and YZ position spring values on ConfigurableJoints in a named object’s active hierarchy. This does not create joints or change linear joint drives. Related: Physics. doc:cs-bridge-jsetDriveSprings
  • setHeadtowing — Set the prepared dancer rig’s head-towing behavior on or off; this selects existing rig behavior and does not create a joint or tow cable. Related: Objects with Special Functions. doc:cs-bridge-jsetHeadtowing
  • setJoint — Legacy joint-related wrapper with an unresolved Unity receiver; its effect is unverified, so do not rely on it as a working student API. [receiver unresolved; public API status needs review] Related: Physics. doc:cs-bridge-jChangeJoint
  • socketEndCCD — Ends continuous collision detection (CCD) for the supplied socket or joint-related object; the available evidence does not specify its exact effect. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.anchor — Set the anchor point of a joint connecting two objects, changing where the joint pivots relative to the connected objects. doc:j · doc:cs-bridge-getAnchorPosition
  • this.axis — Sets the joint’s primary axis, which determines how its local X, Y, and Z motion and rotation settings map to directions. Related: Physics, Vectors and Rotation Math. doc:p · doc:j · doc:scene · doc:ve · doc:ao · doc:vd · api:actor.setFriction · api:getSceneObject · api:getSceneState · api:measurePlacement · api:getModelAxis · api:wieldWeapon · api:weaponGrip · api:loadGLB · api:measureModel · api:setModelHeight · api:aimWeapon · doc:cs-bridge-jconstrain · doc:cs-bridge-jsetSphereControlAxis
  • this.breakForce — Sets the force threshold at which a joint breaks, useful for testing breakable connections in physics-based machines or structures. Related: Physics. doc:j
  • this.breakTorque — Sets the torque threshold at which a joint breaks, useful for making connected parts separate under force. Related: Physics. doc:j
  • this.currentForce — Gets or sets the current force value for a joint; the available evidence does not specify its units or effects. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.currentTorque — Set the current torque value for a joint through the joint-change operation. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.lockAxes — Legacy wrapper associated with axis locking; its receiver is unresolved, so its effect and availability are unverified. [receiver unresolved; public API status needs review] doc:cs-bridge-jLockAxes
  • this.rotationDriveMode — Set the rotation drive mode for a joint. Related: Physics. No exact documentation anchor; review required.
  • this.secondaryaxis — Sets a joint’s secondary axis, which determines how its local Y axis and motion settings map relative to the joint’s configured primary axis. Related: Vectors and Rotation Math. doc:j
  • this.slerpDriveForce — Sets the maximum force used by a joint’s slerp drive. Related: Physics. doc:j
  • this.slerpDriveMotor — Sets the slerp drive motor value on a joint, for controlling motorized motion between connected objects. Related: Physics. doc:j
  • this.slerpDriveSpring — Set the slerp drive spring value on a joint to adjust its spring-like drive behavior. Related: Physics. doc:j
  • this.targetAngularVelocity — Sets the target angular velocity for the stock Jeep’s four wheel joints, affecting its physics-driven movement. Requires the Jeep and its joints to be initialized; the value is not a linear speed or a guaranteed stopping command. Related: Physics. doc:j · api:jeep.setSpeed
  • this.targetPosition — Sets a joint’s target position, which a linear spring drive uses as its desired resting position along the joint axis. Related: Physics. doc:j
  • this.targetRotationQuaternion — Read or set the target rotation quaternion for a joint; the provided reference identifies it as part of a joint-change operation. [public API status needs review] Related: Physics, Vectors and Rotation Math. No exact documentation anchor; review required.
  • this.targetRotationXYZ — Sets the target rotation for a joint’s angular drive, such as steering a vehicle through its front joints. The target does not directly rotate or teleport the connected objects. Related: Physics. doc:j · api:jeep.setSteering
  • this.targetVelocity — Sets a joint motor's target speed using a vector, driving connected objects along the joint's main axis. Related: Physics. doc:j
  • this.xAngularDriveForce — Sets the maximum force available to drive a joint’s angular motion, for example when configuring a joint motor. Related: Physics. doc:j
  • this.xAngularDriveMotor — Sets the angular drive motor value for a joint, allowing the joint to behave like a motor; the example sets it to 500 and then to 0. Related: Physics. doc:j
  • this.xAngularDriveSpring — Sets the spring value for a joint's X-axis angular drive, affecting how the connected objects respond to rotation. Related: Physics. doc:j
  • this.xAngularLimitDamper — Gets or sets the damping value for the joint’s x-axis angular limit. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.xAngularLimitHigh — Sets the joint's upper angular limit along its X axis, in degrees, for a connected pair of objects. doc:j
  • this.xAngularLimitHighBounce — Sets the high-limit angular bounce value for a joint, affecting how it responds when rotation reaches its upper limit. Related: Physics. doc:j
  • this.xAngularLimitLow — Sets the low limit of a joint’s X-axis angular range, for controlling how far connected objects can rotate. doc:j
  • this.xAngularLimitLowBounce — Sets the low-end angular limit bounce property on a joint, affecting how it responds when reaching its lower angular limit. doc:j
  • this.xAngularLimitSpring — Sets the angular limit spring value for a joint, affecting its response at the angular limit. Related: Physics. No exact documentation anchor; review required.
  • this.xAngularMotion — Sets whether a configurable joint's X-axis angular motion is free, limited, or fixed. After defining joint axes, X refers to the joint's configured axis, which may not match world X. Related: Physics. doc:j
  • this.xLinearDriveForce — Sets the maximum force available to a joint’s linear drive, for controlling how strongly it can drive connected objects. Related: Physics. doc:j
  • this.xLinearDriveMotor — Sets the joint’s X-axis linear drive motor value, allowing you to configure motor behavior between two joined objects. Related: Physics. doc:j
  • this.xLinearDriveSpring — Set the spring strength of a joint’s X linear drive to change how the connected objects respond along that axis. Related: Physics. doc:j
  • this.xLinearLimit — Sets the joint's X-axis linear travel limit; for example, a limit of 5 restricts the connected object to moving 5 units away before the joint stops it. Related: Physics. doc:j
  • this.xLinearLimitBounce — Set how much a joint bounces when it reaches its X linear limit. Related: Physics. doc:j
  • this.xLinearLimitDamper — Sets the damping for a joint’s X-axis linear limit, controlling how much shock absorption the limit provides. doc:j
  • this.xLinearLimitSpring — Sets the springiness of a joint’s linear limit, useful for building spring-like connections between objects. Related: Physics. doc:j
  • this.xLinearMotion — Sets the joint’s X-axis linear motion mode to free, limited, or fixed; the axis may be remapped by the joint’s axis settings. Related: Physics. doc:j
  • this.yAngularDriveForce — Set the Y-axis angular drive force for a joint, for controlling joint-driven rotational motion. Related: Physics. No exact documentation anchor; review required.
  • this.yAngularDriveMotor — Access or set the Y-axis angular drive motor for a joint; the available evidence does not specify the accepted value or behavior. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.yAngularDriveSpring — Sets the spring value for a joint’s Y-axis angular drive. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.yAngularLimit — Sets the joint’s Y angular limit, controlling how far connected objects can rotate around that joint axis. Related: Physics. doc:j
  • this.yAngularLimitBounce — Set the bounce response at a joint’s Y angular limit, affecting how connected objects respond when reaching that rotational limit. Related: Physics. doc:j
  • this.yAngularMotion — Sets the joint’s Y angular-motion mode (free, limited, or fixed) in the joint’s configured axes; those axes may not match world XYZ if custom axes are set. Related: Physics. doc:j
  • this.yLinearDriveForce — Set the force value for a joint’s Y-axis linear drive. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.yLinearDriveMotor — Gets or sets the motor value for a joint’s Y-axis linear drive. Related: Physics. No exact documentation anchor; review required.
  • this.yLinearDriveSpring — Gets or sets the spring setting for a joint's linear drive along the Y axis; the available evidence does not specify accepted values or effects. Related: Physics. No exact documentation anchor; review required.
  • this.yLinearLimit — Sets the Y-axis linear limit for a configurable joint, controlling its permitted linear movement along that joint axis. Related: Physics. doc:j
  • this.yLinearLimitBounce — Gets or sets the bounce value for a joint’s Y-axis linear limit. Related: Physics. No exact documentation anchor; review required.
  • this.yLinearLimitDamper — Gets or sets the Y-axis linear limit damper for a joint, controlling damping at its travel limit. Related: Physics. No exact documentation anchor; review required.
  • this.yLinearLimitSpring — Read or set the Y-axis linear limit spring for a joint, for tuning how the joint responds at its movement limit. Related: Physics. No exact documentation anchor; review required.
  • this.yLinearMotion — Set the joint’s Y-axis linear motion mode, such as free, limited, or fixed. The joint axis may be remapped by its axis settings, so Y may not mean world Y. Related: Physics. doc:j
  • this.yzAngularDriveForce — Sets a joint's YZ angular drive force limit, controlling the maximum force available to drive angular motion on those axes. Related: Physics. doc:j
  • this.yzAngularDriveMotor — Set the angular drive motor value for a joint’s Y- and Z-axis angular motion. Related: Physics. doc:j
  • this.yzAngularDriveSpring — Sets the YZ angular drive spring property on a joint, controlling spring behavior for angular movement on that joint. Related: Physics. doc:j
  • this.yzAngularLimitDamper — Set the damping value for a joint’s YZ angular limit, affecting how motion at that limit is damped. Related: Physics. doc:j
  • this.yzAngularLimitSpring — Sets the spring strength for a joint's Y/Z angular limits, helping configure how a connected object behaves when it rotates against those limits. Related: Physics. doc:j
  • this.zAngularDriveForce — Set the drive force for a joint’s angular motion around the Z axis; available usage details are unclear. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.zAngularDriveMotor — Gets or sets the angular-drive motor value for a joint, as used by the joint-change operation. Related: Physics. No exact documentation anchor; review required.
  • this.zAngularDriveSpring — Set the spring value for a joint’s angular drive on the Z axis. Related: Physics. No exact documentation anchor; review required.
  • this.zAngularLimit — Sets the joint’s Z-axis angular limit, controlling how far connected objects can rotate along that joint axis. Related: Physics. doc:j
  • this.zAngularLimitBounce — Sets the bounce value for a joint’s Z-axis angular limit, affecting how the joint responds when it reaches that limit. Related: Physics. doc:j
  • this.zAngularMotion — Sets the joint’s local Z angular-motion axis; when joint axes are configured, motion axes may no longer match world XYZ. Related: Physics. doc:j
  • this.zLinearDriveForce — Sets or reads the Z-axis linear drive force for a joint; the supplied reference does not specify its value range or behavior in detail. Related: Physics. No exact documentation anchor; review required.
  • this.zLinearDriveMotor — Sets or reads the motor value for a joint’s Z-axis linear drive; the available evidence does not specify accepted values or behavior in detail. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.zLinearDriveSpring — Sets the spring value for a joint’s Z-axis linear drive; the accepted value and effect are not specified in the supplied evidence. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.zLinearLimit — Sets the joint’s Z-axis linear limit value, constraining how far connected objects can move along that joint axis. Related: Physics. doc:j
  • this.zLinearLimitBounce — Sets the bounce value for a joint’s Z-axis linear limit; the available evidence does not establish whether this accessor is intended for student use. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.zLinearLimitDamper — Gets or sets the damper for a joint’s Z-axis linear limit. [public API status needs review] Related: Physics. No exact documentation anchor; review required.
  • this.zLinearLimitSpring — Set the spring value for a joint’s Z-axis linear limit. Related: Physics. No exact documentation anchor; review required.
  • this.zLinearMotion — Sets the joint's Z linear-motion axis, interpreted in the joint's configured axis frame rather than necessarily world Z. Related: Physics. doc:j
  • useWeights — Enable or disable use of the prepared dancer’s weight system; requires the prebuilt rig. The documented hand-grab operation also changes this setting, so it affects the weight system used for throwing. Related: Objects with Special Functions. doc:cs-bridge-juseWeights · doc:cs-bridge-jsetHandgrab
  • window[name].breakJoint — Break the pendulum’s joint connection, allowing its attached part to separate; use with the stock pendulum object. Related: Objects with Special Functions. doc:spafoo

Simulation Controls

Navigation only. Read exact references before using a function. Search tasks: restart a game after Play, reset runtime state between attempts, rebuild game setup after clearRun, saved challenge replay cleanup, pause a game simulation, freeze gameplay temporarily, pause and resume a physics scene, run simulation when browser tab is hidden, background simulation control, keep a game running in the background, browser visibility and simulation behavior, change fixed physics time step.

Internal helpers — not student API recommendations
  • updateObjects — Internal update loop that copies object transform and motion state from shared memory into JavaScript objects, then runs one queued operation. This is infrastructure, not a student-facing command. [operation documentation needs review] Related: Physics, Setting Position, Rotation and Scale After Loading. doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans

Scene

Navigation only. Read exact references before using a function. Search tasks: measure scenery object dimensions, get prop world bounds, inspect current object transform, position objects using scene measurements, inspect scene objects and bounds, list registered scenery runtime objects, read object transforms for scene analysis, export scenery object state, hide XYZ axes in scene, turn off axis guides, clean up the scene view, hide coordinate axes while building a scene.

  • clearBlockingMarkers — Clears blocking markers from a scene; the available evidence does not establish where or when this operation works. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • clearEnvironment — Sends a `clear` command to the environment command receiver. The specific effect and runtime availability are not established by the available evidence. [operation documentation needs review; public API status needs review] Related: Lighting. No exact documentation anchor; review required.
  • clearMovieSet — Clears the environment, blocking markers, scene objects, and specified terrains (or all listed terrains by default), then resets the current movie-set state. [operation documentation needs review; public API status needs review] Related: Terrain, Water and paths. No exact documentation anchor; review required.
  • clearStage — Legacy clearStage wrapper with no matching Unity receiver found; its effect and runtime behavior are unverified. Do not recommend it for use without identifying a receiver and testing it. [receiver unresolved; public API status needs review] doc:cs-bridge-clearStage
  • downloadMovieSet — Exports a movie-set manifest for the requested terrains and downloads it as a JSON file. Runtime availability of the underlying operations is not established here. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • exportMovieSet — Collect terrain exports, scene objects, environment state, and blocking markers into a movie-set data object. Terrain names may be supplied; otherwise it requests the terrain list. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • getBlockingMarker — Retrieves a marker identified by name; the available evidence does not establish what the marker contains or whether this wrapper is runtime-available. [operation documentation needs review; public API status needs review] Related: Game Play and hidden outcomes. No exact documentation anchor; review required.
  • getCSSceneCapabilities — Queries the scene command for capability information; the available capabilities and runtime behavior are not documented in the reviewed evidence. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • getEnvironmentCapabilities — Requests environment capability information through the environment command bridge; the available response and student-facing use are not established by the supplied evidence. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • getEnvironmentState — Retrieve the current environment state through the environment command bridge; the specific state fields are not documented here. [operation documentation needs review; public API status needs review] Related: Lighting. No exact documentation anchor; review required.
  • getSceneNodes — Requests scene node names for a supplied name through the scene-command bridge; the operation’s runtime availability is not verified. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • getSceneObject — Read a registered scenery object's current position, rotation, scale, and world-space renderer bounds for measuring or positioning scene props. Related: Loading and Positioning Objects, Working with Meshes. api:getSceneObject
  • getSceneState — Read the scenery runtime’s registered objects and their current transforms and renderer bounds. This is not a complete Unity hierarchy listing and excludes legacy actors, terrain, environment records, and blocking markers. Related: Working with Meshes. api:getSceneState
  • getSceneStats — Requests scene statistics, optionally for a named scene; the available evidence does not specify which statistics are returned or confirm runtime availability. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • hide — Hide the visual renderers of a named scenery object. The available evidence is mixed with older stage, foliage, and badge behavior, so verify which operation this wrapper exposes before relying on it; hiding may not disable collisions or physics. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:scene · api:setSceneVisible · doc:cs-bridge-hideFoliage · doc:cs-bridge-stageCollisionsNo · doc:cs-bridge-HideBadge
  • hideAxes — Hides the XYZ axis guides in the scene view. Related: Editor Basics. doc:scene
  • hideBlockingMarker — Hide a blocking marker identified by its ID; the reviewed contract does not establish when or where the marker is available. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • hideSky — Hide the skybox and switch the Main Camera to a transparent solid-color background; set a specific background color separately with setBackgroundColor. Related: Cameras, Visual Effects. doc:cs-bridge-hideSky · doc:cs-bridge-setBackgroundColor
  • hideStage — Hides the scene's ground plane (stage). doc:scene
  • listBlockingMarkers — Returns the markers identified as blocking markers in the scene; the available evidence does not specify how they are used or whether this operation is available to students. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • loadMovieSet — Loads movie-set data, records the current movie-set name, and optionally displays its controls. Availability and supported sources are not confirmed by this evidence. [operation documentation needs review; public API status needs review] Related: User Interface Elements, Animating Objects. No exact documentation anchor; review required.
  • removeBlockingMarker — Requests removal of the named blocking marker from the scene; the available evidence does not establish what the marker blocks or whether the operation is available to students. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • removeSceneObject — Remove an existing imported scenery instance from the live scene and exclude it from future scene exports. This does not delete the hosted asset or remove a stock CS actor. Related: Loading and Positioning Objects, Objects: Check back Weekly for new objects. api:removeSceneObject
  • removeScenery — Legacy attempt to find and destroy a scene object by name. The source flags this route as nonworking, so do not rely on it; use the documented cleanup API for the modern movie-set/GLB loader instead. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-removeScenery
  • resetEnvironmentSettings — Requests a reset of environment settings through the environment command bridge; the specific settings affected are not documented. [operation documentation needs review; public API status needs review] Related: Lighting. No exact documentation anchor; review required.
  • restoreEnvironment — Restore a saved environment state, including scene settings and named environment objects; if creation fails, remove objects created during the attempt and try to restore the prior settings. [operation documentation needs review; public API status needs review] Related: Lighting, Water and paths. No exact documentation anchor; review required.
  • restoreMovieSet — Restores a movie-set manifest by recreating its terrains, scenery, markers, and supported environment and object state. Restoration can fail when the manifest is invalid, names or markers conflict with existing content, or required runtime capabilities are unavailable. [operation documentation needs review; public API status needs review] Related: Terrain, Water and paths. No exact documentation anchor; review required.
  • restoreStage — Legacy wrapper targeting `restoreStage`; its receiver is unresolved, so its effect is unknown and it is not verified for use. [receiver unresolved; public API status needs review] doc:cs-bridge-restoreStage
  • saveMovieSet — Exports and saves a non-empty movie set containing scene objects, markers, terrain, and supported environment data under a validated set name. The wrapper requires the set to be loaded; runtime availability is not confirmed by this evidence. [operation documentation needs review; public API status needs review] Related: Terrain, Water and paths. No exact documentation anchor; review required.
  • screenshot — Requests a legacy Unity screenshot through PrintRoutine. It does not return an image or Promise and is not the Workshop screenshot or video-review transport. [public API status needs review] doc:cs-bridge-screenshot
  • setBlockingMarker — Sets a blocking marker through the scene command interface; the available evidence does not specify its effect or runtime availability. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • setScene — Legacy API for replacing the active Unity scene with a supplied built-in scene name. It hides registered objects and unloads the current scene; it cannot download movie-set content, for which use loadMovieSet. [public API status needs review] doc:cs-bridge-setScene
  • setSceneMotion — Requests a motion setting for a named scene item; the available motions and runtime support are not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Animating Objects. No exact documentation anchor; review required.
  • setScenePath — Sets a path value for a named scene entry; the available evidence does not specify what uses that path. [operation documentation needs review; public API status needs review] Related: Water and paths. No exact documentation anchor; review required.
  • setSceneVisible — Show or hide the visual renderers of registered scenery. Hiding does not remove the object, its colliders, or its physics; await the returned scene reply before dependent operations. Related: Objects: Check back Weekly for new objects. api:setSceneVisible
  • setSky — Changes the scene sky to a named sky type, such as 'bluesky' or 'Galaxy3'. Related: Lighting. doc:scene
  • setWorldObjectVisible — Sets the visibility flag for a named world object through the environment command bridge; runtime availability and supported objects are not verified. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • showAxes — Show the XYZ axes in the scene as a spatial reference. Related: Vectors and Rotation Math. doc:scene
  • showBlockingMarker — Show or hide a scene marker identified by id; visibility defaults to true. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • showMovieSetControls — Adds an on-screen control bar for saving the current scene as a movie set, loading or unloading a saved set, refreshing the saved-set list, and downloading a JSON manifest. Availability of the connected operations is not verified. [operation documentation needs review; public API status needs review] Related: Loading and Positioning Objects, Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • showStage — Shows the scene's ground-plane stage. doc:scene
  • stageHeight — Move the built-in ground plane vertically, resetting its X and Z position to zero. Pass the height as a string; this does not sculpt Terrain or reposition existing props. Related: Terrain. doc:cs-bridge-stageHeight
  • unloadMovieSet — Queues clearing the current movie set and resets its current-set reference; the runtime contract is not separately reviewed. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • updateGravity — Loads the Unity scene named by the supplied string and unloads asset bundles, destroying their assets. It does not change gravity; runtime behavior has not been verified. [known limitation; public API status needs review] doc:cs-bridge-updateGravity
Internal helpers — not student API recommendations
  • csSceneCommand — Internal JavaScript transport that forwards scene commands to the receiver; no separate student-facing contract is documented. [operation documentation needs review] No exact documentation anchor; review required.
  • send — Internal command dispatcher that forwards operations and options to environment, scene, or terrain handlers; the supplied evidence does not establish it as a student-facing API. Related: Terrain. doc:ao · doc:te · doc:chat · doc:ui · doc:jpb · doc:forloop · api:characterInput
  • unityLoaded — Internal Unity-load startup callback that focuses the canvas, routes a pending URL script, and begins locating editor objects. It is infrastructure, not a student-facing command. [operation documentation needs review] Related: Editor Basics. doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans

Visual Effects

Navigation only. Read exact references before using a function. Search tasks: camera post-processing effects, add bloom to a scene, sepia camera effect, motion blur visual effect, add smoke or fire to a game object, attach visual effects to objects, add snow effects to a scene, spawn a particle effect at a position, add a timed visual effect to a game event, scale a particle effect, show an impact or arrival effect, remove camera bloom effect.

  • addCameraFx — Applies a visual effect to the camera, such as bloom, sepia, or motion blur. Related: Cameras. doc:ve
  • addVfx — Attaches a named visual effect, such as smoke, fire, or snow, to a specified object. doc:ve
  • changeParticles — Reconfigures the particle system previously selected with initializeParticles, applying supported settings such as particle type, maximum count, collision behavior, and emission rate. It stops, clears, and restarts that system; duration is parsed but not applied. [public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-changeParticles
  • effectAt — Spawns an installed ParticleSystem prefab at a specified world-space point for a chosen duration and scale; it does not download or create effects. Related: Objects with Special Functions. api:effectAt
  • removeCameraFx — Removes the specified visual effect from the camera, such as bloom. Related: Cameras. doc:ve
  • removeVfx — Removes a named visual effect from the specified object, such as smoke from a box. doc:ve
  • setParticleUpdateType — Selects whether shared-particle updates use position or velocity; requires the selected ParticleSystem and SharedFloats buffer. Unsupported strings match neither update branch. Runtime behavior is not verified. [public API status needs review] doc:cs-bridge-setParticleUpdateType
  • setScenePostProcessing — Passes post-processing options to the scene environment command to affect the scene’s visual appearance; runtime availability is not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • updateParticles — Updates the selected ParticleSystem’s live particle positions or velocities from shared XYZ buffer values. Requires prior initialization and enough buffer data; it does not create or style effects. [public API status needs review] Related: Visualizing Data. doc:cs-bridge-updateParticles
  • updateParticlesOff — Disables the automatic shared-particle updater by clearing Unity’s ParticlesOn flag. It does not destroy the particle system or necessarily stop its own simulation; the argument is unused. Related: Simulation Controls. doc:cs-bridge-updateParticlesOff
  • updateParticlesOn — Enables the existing automatic shared-particle updater by setting Unity’s ParticlesOn flag. Initialize the target and shared buffer first; the argument is unused, and no update frequency is specified. [public API status needs review] Related: Simulation Controls. doc:cs-bridge-updateParticlesOn
  • window[name].add — Attaches a visual effect to a named object; the available effect types are not fully specified in the supplied evidence. doc:ve · doc:chat · doc:vd · doc:sg · doc:il · doc:jpb · doc:forloop · doc:water-and-paths · api:actor.setFriction · api:jeep.getSpeed · api:setSceneRigidbody · doc:cs-sendmessage-reference · doc:cs-bridge-addDontGrab · doc:cs-bridge-javascriptControlOn · doc:cs-bridge-jsetBalance · doc:cs-bridge-jsetBoxCollider · doc:cs-bridge-jsetDragbyhitbone · doc:cs-bridge-jsetHips · doc:cs-bridge-jsetSwoopLerp · doc:cs-bridge-jsetWingit · doc:cs-bridge-showWeights · doc:cs-bridge-yesCollisions · doc:game-sound-control
  • window[name].smokeOn — Legacy wrapper appears intended to control an actor's smoke behavior using a speed argument, but its Unity receiver is unresolved and runtime behavior is unverified. Do not recommend it as a working API until confirmed. [receiver unresolved; public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-smokeOn
  • window[name].startJets — Plays the existing left and right rocket ParticleSystems on a jetpack prefab. It does not apply propulsion force. Related: Objects with Special Functions. doc:cs-bridge-startJets
Internal helpers — not student API recommendations

Character Animations

Navigation only. Read exact references before using a function. Search tasks: dancer animation action target, set a character’s next action target, interactive character choreography, direct a dancer toward a named target, clear upper-body character animation layer, remove masked animation layer from a character, keep base animation playing while clearing upper-body animation, blend character animation clips, smoothly transition between character actions, crossfade idle and movement animations, set animation speed and looping, dancer rig dragging mode.

  • addActionTarget — Adds a named target to a prepared dancer character’s action targets. It does not provide general-purpose AI planning or navigation. Related: Objects with Special Functions. doc:cs-bridge-jaddActionTarget
  • animationToString — Legacy animation-related wrapper with no matching Unity receiver found; its effect is unverified, so do not rely on it or call the raw SendMessage route as a workaround. [receiver unresolved; public API status needs review] Related: Animating Objects. doc:cs-bridge-jAnimationToString
  • clearModelAnimationLayer — Removes a character model’s masked upper animation layer while leaving base animation playback intact; await completion before dependent commands. Related: Animating Objects. api:clearModelAnimationLayer
  • crossFadeModelAnimation — Crossfades a loaded model from its current base animation to a specified clip over a duration, with configurable speed and looping. Related: Animating Objects. api:crossFadeModelAnimation
  • dragItNoY — Enable or disable the prepared dancer rig’s dragging mode; this is specific to that rig and does not set a general Rigidbody constraint or add a controller. Related: Objects with Special Functions. doc:cs-bridge-jdragItNoY
  • getModelAnimationState — Read the managed animation playback snapshot for a loaded model, including its selected clip, status, time, duration, speed, and loop setting. Use it to inspect or coordinate visual animation playback; it does not add physics behavior. Related: Animating Objects, Objects with Special Functions. api:getModelAnimationState
  • layerModelAnimation — Plays one masked animation clip on a specified bone branch over a character’s currently playing base animation. Use a valid clip and unique bone path; the layer weight ranges from 0 to 1. Related: Animating Objects. api:layerModelAnimation
  • playAnimationFromMemory — Plays track 0 from the shared animationMemory buffer; requires recorded rig data to be loaded there and is not a GLB clip player. Related: Animating Objects. doc:cs-bridge-playAnimationFromMemory
  • restoreBoneInfo — Restore saved local rotations for matching bones in a prepared dancer hierarchy. doc:cs-bridge-restoreBoneInfo
  • setAnimation — Crossfade a root Animator or legacy Animation component to a named clip and set its playback speed; imported GLBs require the documented model-animation API and available clip names. [public API status needs review] Related: Animating Objects. doc:cs-bridge-setAnimation
  • setBalance — Change the balance setting on a prepared dancer, or enable or disable an already attached balance script. This is rig-specific and does not add the script when it is missing. Related: Objects with Special Functions. doc:cs-bridge-jsetBalance
  • setBalanceLerp — Sets the balance-lerp parameter on the prepared dancer. Requires the existing rig; no clamping or general-model balancing fallback is provided. [public API status needs review] doc:cs-bridge-jsetBalanceLerp
  • setFrontstep — Selects the prepared dancer’s existing frontstep rig behavior; it does not create a walk animation or character controller. Related: Objects with Special Functions. doc:cs-bridge-jsetFrontstep
  • setHips — Set the hips boolean on a prepared dancer that already has a rig; this does not move a hip bone or add an animation track. Related: IK Animation. doc:cs-bridge-jsetHips
  • setLerpZAdjust — Adjusts the prepared dancer’s existing `lerpZAdjust` rig parameter; it does not set the dancer’s world-space Z position. [public API status needs review] Related: IK Animation. doc:cs-bridge-jsetLerpZAdjust
  • setMouseControlType — Sets the supplied mouse-control mode string on a prepared dancer. Use an existing demonstrated mode; the accepted choices are not validated or specified here. [public API status needs review] Related: Behaviors. doc:cs-bridge-jsetMouseControlType
  • setRecordLimit — Set the integer record limit for a prepared dancer's rig recorder. Fractional or nonnumeric values are invalid; the limit's units are not specified. [public API status needs review] Related: Animating Objects. doc:cs-bridge-jsetRecordLimit
  • setSidestep — Enable or disable the prepared dancer’s existing sidestep behavior. doc:cs-bridge-jsetSidestep
  • setTargetPunch — Set a prepared dancer’s numeric targetPunch parameter to tune its existing behavior; this does not create a punch animation or define damage rules. [public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-jsetTargetPunch
  • setWingit — Toggle the existing wingit behavior on a prepared dancer rig; this does not add wings, skeletal animation, or flight physics to a GLB. Related: Objects with Special Functions. doc:cs-bridge-jsetWingit
  • startAutoPlayer — Starts the prepared dancer’s existing automatic player for a named body part. Requires that actor’s dancer implementation and a valid body-part name; it is not general navigation or pathfinding. doc:cs-bridge-startAutoPlayer
  • stopAutoPlayer — Stops the prepared dancer’s existing automatic player; does not stop the Workshop team or unload the actor. Related: Objects with Special Functions. doc:cs-bridge-stopAutoPlayer
  • weaponGrip — Set a held prop’s grip orientation preset and length axis; calibration changes require weapon IK to be disabled. Related: IK Animation. api:weaponGrip
  • window[name].animateJoint — Animate a character joint’s rotation over a specified duration, optionally calling a function with a parameter when the animation finishes. [operation documentation needs review; public API status needs review] Related: Animating Objects. doc:ao
  • window[name].hold — Rewind a model’s selected animation to time zero, hold its initial pose, and report that playback has stopped. The supplied evidence describes stopModelAnimation, so the connection to window[name].hold is uncertain. [public API status needs review] Related: Animating Objects. api:stopModelAnimation

Animating Objects

Navigation only. Read exact references before using a function. Search tasks: play imported animation clips, animate object movement in a game, animate rotation and scale over time, animate character joints, inverse kinematics goal object, make a character reach for an object, cancel object tween animation, stop LeanTween motion, cancel scheduled tween effects, animation completion callbacks, list model animation clips, find exact animation clip names.

  • animate — Animate an object's position, rotation, or scale over time, or animate a character joint; the accompanying IK operations start or stop joint control using a goal object. Animation may bypass normal physics, so use documented movement APIs when realistic physics is needed. Related: IK Animation. doc:ao · doc:ia · api:makeCSObject
  • cancelAnimations — Cancels all LeanTween animations, which may also invoke their completion callbacks. It does not stop GLB clips, Animator states, or physics. doc:cs-bridge-cancelLeans
  • checkAudioMaster — Starts the legacy rig/animation recording workflow after its recording setup is in place. It is not a general-purpose game audio recorder. [public API status needs review] doc:cs-bridge-startRecording
  • getModelAnimations — List the exact animation clip names available on a loaded model so you can choose a clip for managed playback. Related: Character Animations. api:getModelAnimations
  • getSceneAnimations — Retrieve the names of animations associated with the specified scene name. Runtime availability and the exact target are unverified. [operation documentation needs review; public API status needs review] Related: Character Animations. No exact documentation anchor; review required.
  • pauseAnimation — Stops animation on an object: a root Animator has its speed set to zero, while a root legacy Animation is stopped and its joints restored. The speed argument is ignored, and the legacy branch is not resumable as a pause. Related: Character Animations. doc:cs-bridge-pauseAnimation
  • pauseModelAnimation — Pause a managed animation on a loaded model at its current pose and playhead; playback must already have a selected clip. Related: Character Animations. api:pauseModelAnimation
  • playModelAnimation — Play, pause, resume, stop, or inspect an imported animation clip on a loaded model. Use exact clip names; this controls visual animation, not physics movement. Related: Character Animations. api:playModelAnimation
  • playSceneAnimation — Play a named animation clip in the scene, with optional animation settings. The receiver and runtime availability are not verified. [operation documentation needs review; public API status needs review] Related: Character Animations. No exact documentation anchor; review required.
  • restartModelAnimation — Restart the selected animation clip on a loaded model, preserving its current speed and loop setting; negative speed starts from the clip’s end. Requires a compatible Unity build and a previously selected clip. Related: Character Animations. api:restartModelAnimation
  • resumeModelAnimation — Resume the selected animation clip on a loaded model at its current playhead position without resetting it; a finished one-shot clip remains at its boundary. Related: Character Animations. api:resumeModelAnimation
  • setAnimationSpeed — Change the playback speed of an enabled root Animator or currently playing root legacy Animation states; this does not start clips or find animation players nested in arbitrary imported GLBs. Related: Character Animations. doc:cs-bridge-setAnimationSpeed
  • setModelAnimationSpeed — Change the playback speed of a selected animation on a loaded model, including freezing or reversing it; this does not select or resume a clip. Related: Character Animations. api:setModelAnimationSpeed
  • showAnimationExplorer — Open a control-panel explorer to select and manage imported animation clips on an already-loaded model, including playback, looping, speed, and playhead controls. Related: Character Animations, User Interface Elements. api:showAnimationExplorer
  • startRecording — Starts legacy rig/animation recording on animation track 0; it requires the legacy recording setup and is not a general-purpose game audio recorder. [public API status needs review] Related: Character Animations. doc:cs-bridge-startRecording
  • stopModelAnimation — Stop managed playback of a loaded model’s selected animation and return it to its initial pose; requires a compatible model and previously selected clip. Related: Character Animations. api:stopModelAnimation
  • stopSceneAnimation — Requests that a named scene animation stop by setting its playing state to false; runtime availability is unverified. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • this.animateMove — Animates an object's position change over a specified duration, with an optional completion callback and parameter. The documentation warns that this animation bypasses regular physics; set vertical acceleration to zero before using it, and use velocity or acceleration for realistic motion. [operation documentation needs review] Related: Physics. doc:ao · doc:ia
  • this.animateRotate — Animate an object's rotation over a specified duration, optionally calling a function with a parameter when the animation finishes. Animated rotation may conflict with regular physics; realistic rotation should use angular velocity instead. [operation documentation needs review; public API status needs review] Related: Physics. doc:ao
  • this.animateScale — Animate an object's scale to the specified x, y, and z values over a duration, optionally calling a completion function with a parameter. Animated objects do not experience regular physics during the change and may behave unexpectedly; a scale of 0 gives that axis zero thickness. [operation documentation needs review] Related: Setting Position, Rotation and Scale After Loading. doc:ao

IK Animation

Navigation only. Read exact references before using a function. Search tasks: show IK goal markers, calibrate a character’s weapon grip, aim a character’s weapon at a target, weapon arm IK aiming, point a weapon toward a world position, character rig inverse kinematics, aim a character’s weapon toward the camera, camera-directed weapon aiming with IK, character arm pose for a wielded weapon, inspect IK pose after a rendered frame, stop character IK animation, disable inverse kinematics on a character.

  • aimWeapon — Aim a wielded weapon’s calibrated arm chain toward a Unity-world point using continuous IK. Await configuration, then inspect the solved pose after a rendered frame; it changes arm rotations only and preserves character physics, gravity, and animation goals. Related: Character Animations, Objects with Special Functions. api:aimWeapon
  • aimWeaponWithCamera — Continuously aim a wielded weapon along the existing MainCamera direction using the character’s IK rig; disabling it restores the configured local rotation. It changes visual arm rotations only and requires a loaded weapon and initialized hand rig. Related: Cameras, Objects with Special Functions. api:aimWeaponWithCamera
  • endIK — Turns off inverse-kinematics animation for the named object. Related: Character Animations. doc:ia
  • getCharacterRig — Inspect a loaded character's rig to find transform paths and positions for hands, head, or other rig parts; use explicit paths when a selection is ambiguous. Related: Character Animations, Loading and Positioning Objects. api:getCharacterRig
  • getWeaponIK — Read back a weapon’s IK configuration and solved pose, including enablement, chain, aim, weight, and hand/support reach errors. Inspect after a rendered frame to evaluate the result. Related: Objects with Special Functions, Animating Objects. api:getWeaponIK
  • handGrabAttachToCenterOn — Set a prepared character’s hand-grab behavior to attach at the center; this does not create a grab component or rig. Related: Objects with Special Functions, Behaviors. doc:cs-bridge-handGrabAttachToCenterOn
  • hideGoals — Show or hide the prepared IK goal markers by enabling or disabling their mesh renderers; this changes visibility only, not the goals’ physics or control. Related: Objects with Special Functions. doc:cs-bridge-jshowGoals
  • hideWeights — Hide the MeshRenderers on prepared left/right hand and foot weight objects. This changes visibility only; it does not balance feet, despite the misleading setFootBalance wrapper. Related: Objects with Special Functions. doc:cs-bridge-hideWeights
  • moveWeapon — Request a weapon’s origin in character-local coordinates and use inverse kinematics to move the arm while the weapon remains in the hand. It does not move the character root; inspect the result after a rendered frame and account for reach limits. Related: Objects with Special Functions, Vectors and Rotation Math. api:moveWeapon
  • removeActionTarget — Remove a named target from a prepared dancer character’s action targets; this does not delete the target from the scene. Related: Character Animations. doc:cs-bridge-jremoveActionTarget
  • resetTargetRotations — Intended to reset target-object rotations, but the JavaScript wrapper passes an object-name string to a receiver expecting a GameObject, so this bridge is not reliable for resetting poses. [known limitation; public API status needs review] Related: Setting Position, Rotation and Scale After Loading. doc:cs-bridge-resetTargetRotations
  • rotateWeapon — Requests a wielded weapon’s orientation in character-local Euler degrees and lets the wrist follow. This stops automatic aiming; inspect the IK result after a rendered frame. Requires the matching WebGL setup and an initialized hand rig. Related: Objects with Special Functions. api:rotateWeapon
  • setBalanceHeight — Set the prepared dancer's numeric balance-height rig parameter; this does not move the terrain or teleport the dancer vertically. Related: Character Animations. doc:cs-bridge-jsetBalanceHeight
  • setCCDGravityOffOn — Sets the prepared dancer’s CCD gravity option on or off for a named actor; this is a rig-specific setting, not global gravity. Related: Character Animations. doc:cs-bridge-setCCDGravityOffOn
  • setCCDHoldPose — Set the prepared dancer’s CCD hold-pose boolean within the existing dancer IK system. Do not install or override another solver for dancer characters. Related: Character Animations. doc:cs-bridge-jsetCCDHoldPose
  • setCCDLerpSpeed — Sets the CCD lerp-speed numeric parameter on a prepared dancer that already has a CCD implementation; it does not provide a universal IK setup for arbitrary rigs. Related: Joints. doc:cs-bridge-jsetCCDLerpSpeed
  • setCCDType — Sets the supplied string as the prepared dancer’s CCD type setting; supported values are not established by the bridge and depend on the rig implementation. [public API status needs review] Related: Joints. doc:cs-bridge-jsetCCDType
  • setDragbyhitbone — Sets the prepared dancer’s dragByHitbone option to choose whether dragging uses the rig’s hit-bone behavior. It does not resolve GLB bones or add IK. [public API status needs review] Related: Character Animations. doc:cs-bridge-jsetDragbyhitbone
  • setSphereControlDistance — Sets the spherecontroldistance value on a prepared dancer’s existing rig controller; it does not set a general collision radius or measure distance. Related: Character Animations. doc:cs-bridge-jsetSphereControlDistance
  • setSymmetryType — Sets the symmetry type string on a prepared dancer rig; valid choices depend on that rig’s examples or implementation, and the bridge does not validate the value. [public API status needs review] Related: Character Animations. doc:cs-bridge-jsetSymmetryType
  • showGoals — Show or hide the renderers on the prepared IK goal objects for a named goal. This changes visibility only; it does not create or remove goals or change their physics or control. Related: Character Animations. doc:cs-bridge-jshowGoals
  • startIK — Starts inverse-kinematics control of a named character joint, which follows the character’s goal1 object. The goal can be moved using regular physics or object animation. Related: Animating Objects, Joints. doc:ia
  • weaponGripPoint — Set a weapon’s grip point in weapon-local coordinates so it aligns with a character’s hand and offset. Disable weapon IK before changing the grip calibration. Related: Character Animations. api:weaponGripPoint
  • weaponIK — Enable or release arm inverse kinematics for a wielded, grip-calibrated prop on eligible non-dancer characters. It affects visual arm rotations only and has rig and scale restrictions; inspect the solved pose after a rendered frame. Related: Objects with Special Functions, Animating Objects. api:weaponIK
  • weaponIKWeight — Blend the visual arm IK weight for a wielded weapon between 0 and 1 over a specified duration. This affects arm pose only; it does not change character animation, physics, or weapon attachment. Related: Character Animations. api:weaponIKWeight
  • weaponOffset — Adjust a held weapon’s hand-local grip offset for character rig calibration; it does not move the weapon handle. Disable weaponIK before changing the offset and await completion before dependent commands. Related: Character Animations, Objects: Check back Weekly for new objects. api:weaponOffset
  • weaponRotation — Adds a local Euler rotation offset to a held weapon after its grip preset; the guide says to disable weapon IK before changing grip calibration. Related: Animating Objects, Objects with Special Functions. api:weaponRotation
  • weaponSupportHand — Bind or release the character’s other hand at a weapon-local foregrip using IK, with optional grip rotation and arm settings. Requires a compatible initialized hand rig and weapon; inspect the solved pose after a rendered frame. Related: Objects with Special Functions. api:weaponSupportHand
Internal helpers — not student API recommendations
  • socketStartCCD — Internal multiplayer input receiver that starts socket-mode CCD on a prepared dancer using an actor and hit-bone path; it is not a student-facing command for starting a network connection. doc:cs-bridge-socketStartCCD

Behaviors

Navigation only. Read exact references before using a function. Search tasks: disable JavaScript control of an object, turn off scripted object behavior, stop controlling a registered game object, enable and disable object behaviors.

  • javascriptControlOff — Disable JavaScript control of a registered CS object without unloading it. The wrapper sends the command only if the object is already in the JavaScript objects registry. Related: Simulation Controls. doc:cs-bridge-javascriptControlOff
  • registerPlayerName — Registers a player name for an existing dancer object with the same name and enables legacy multiplayer mode. It does not sign in an account, change object ownership, or rename an actor. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-registerPlayerName
  • setAutoplayermove — Unresolved legacy JavaScript wrapper for `setAutoplayermove(goname, b)`. Its receiver and effect are unverified, so do not recommend it as a working behavior or use a raw SendMessage call as a workaround. [receiver unresolved; public API status needs review] doc:cs-bridge-jsetAutoplayermove

Chat

Navigation only. Read exact references before using a function. Search tasks: clear speech bubbles in a scene, remove character dialogue bubbles, reset speech bubbles between dialogue scenes.

  • clearSpeechBubbles — Clear all existing speech bubbles. Requires the SpeechBubbleManager to be present. Related: User Interface Elements. doc:cs-bridge-clearSpeechBubbles
  • removeSpeechBubbleManager — Destroys the Unity scene object named SpeechBubbleManager, removing the speech-bubble manager rather than the HTML control panel. Runtime behavior has not been verified. [public API status needs review] Related: Scene. doc:cs-bridge-removeSpeechBubbleManager

Visualizing Data

Navigation only. Read exact references before using a function. Search tasks: measure distance between game objects, clear an object's movement trail, draw a line through plotted data points, visualize a path with coordinates, add points to a line in a scene, show a trajectory or route, visualize a 3D vector field, create a grid of particles, place field markers on a mesh, build a spatial data visualization, visualize an object's movement path, show a physics object's trajectory.

  • addPointToLine — Adds a point at the specified coordinates to a named line, useful for plotting or visualizing a path through data or a scene. Related: Working with Meshes, Animating Objects. doc:vd
  • createField — Creates a grid of vector or particle objects in world space or on a named object, with configurable spacing, totals, and scale. Related: Working with Meshes, Visual Effects. doc:vd
  • createLineContinuous — Creates a continuous line visualization, likely for displaying vector or other changing data. The supplied documentation does not describe its parameters or behavior in detail. [public API status needs review] Related: Working with Meshes. doc:vd
  • createLineDiscrete — Creates a discrete line visualization; the supplied documentation does not explain its parameters or behavior in detail. [public API status needs review] Related: Working with Meshes. doc:vd
  • createLinePoints — Creates vector points for visualizing vectors or other data in a project; the supplied reference does not specify this function’s parameters or output in detail. [public API status needs review] Related: Working with Meshes. doc:vd
  • drawPath — Draws a visible trail of points showing the path an object travels; use resetPath or removePath to manage the trail. Related: Physics, Objects with Special Functions. doc:vd
  • measureDistance — Draw a distance-measurement line from one existing object to another; this visualizes the distance and does not return a numeric value. Removal is keyed to the starting object, and duplicate recorded pairs are rejected. Runtime behavior has not been verified. Related: Vectors and Rotation Math. doc:cs-bridge-measureDistance · doc:cs-bridge-removeDistanceLine
  • removeDistance — Remove the distance line and measurement component associated with a named starting object, and remove its first matching JavaScript registry entry. Related: Objects with Special Functions. doc:cs-bridge-removeDistanceLine
  • removeField — Removes a field created with createField, clearing its grid of visualized objects or vectors. Related: Working with Meshes. doc:vd
  • removeLine — Removes a named vector line visualization. doc:vd
  • removePath — Removes the visual path drawn for a named object, clearing its movement trail. doc:vd
  • resetPath — Resets the visualized path history for a named object, clearing the points drawn to trace its movement. Related: Physics. doc:vd
  • vectorViewer — Display an object's position, velocity, acceleration, or potential/kinetic energy as scaled vectors, with selectable axes. Related: Physics, Vectors and Rotation Math. doc:vd

Working with Meshes

Navigation only. Read exact references before using a function. Search tasks: create a triangle mesh from vertices, replace an object's mesh, build custom 3D geometry, edit mesh vertex and triangle data, align scenery models by shape, estimate a model’s horizontal axis, orient a dock or building in a scene, use world-space direction vectors, inspect an imported GLB model part, find a model node by ID or path, select a car wheel for collider setup, inspect model parts before physics setup.

  • buildMesh — Rebuilds an object's mesh from the coordinates in SharedVertices and triangle indices in SharedTriangles, replacing its current mesh. Related: Objects: Check back Weekly for new objects. doc:wwm
  • colorMesh — Applies a color operation to a named mesh; the supplied documentation gives no further details about how it works. [public API status needs review] Related: Visualizing Data. doc:vd
  • getModelAxis — Estimate a registered scenery model’s dominant horizontal geometry axis to help align it; await the result and treat its direction as ambiguous, especially for symmetric shapes. Related: Setting Position, Rotation and Scale After Loading, Vectors and Rotation Math. api:getModelAxis
  • getModelPart — Read-only lookup of one imported GLB part by stable node ID or unambiguous path; await the Promise before using the live part record. Related: Physics, Loading and Positioning Objects. api:getModelPart
  • getSceneParts — Inspect nodes in imported GLB scenery and read their collider/body details, poses, and bounds. Read-only; use returned node IDs for subsequent part operations, and note that duplicate display paths are ambiguous. Related: Physics, Scene. api:getSceneParts
  • measureModel — Measure an existing imported scenery object’s world-space bounding box in metres without changing it. Await the result before using its dimensions. Related: Loading and Positioning Objects. api:measureModel
  • receiveTrianglesJS — Forwards a string to Unity through the `receiveTriangles` route, but the receiver is unresolved and its runtime effect is unverified; do not rely on it as a working mesh operation. [operation documentation needs review; public API status needs review] doc:cs-bridge-receiveTriangles
  • repeatTextureFromScale — Sets the root renderer’s main texture tiling to match the object’s local X and Y scale. The material or shader must support the texture property; this does not download textures or repaint terrain. Related: Objects: Check back Weekly for new objects. doc:cs-bridge-repeatTextureFromScale
  • setMaterial — Assigns a material bundled under Materials/ to a named Terrain or its root Renderer; it does not download missing materials or load textures from URLs. Related: Terrain. doc:cs-bridge-jsetMaterial
  • setVertices — Unresolved legacy wrapper associated with mesh vertex operations; its effect is unverified, so do not treat it as a working API or call the raw Unity message as a workaround. [receiver unresolved; public API status needs review] doc:cs-bridge-setVertices
  • showWeights — Show the MeshRenderers on the prepared left- and right-hand and foot weight objects. The objects must already exist; this does not add weights or change their mass. [public API status needs review] Related: Objects: Check back Weekly for new objects. doc:cs-bridge-showWeights
  • trianglesToUnity — Legacy JavaScript wrapper targeting Unity's receiveTriangles message; its receiver is unresolved, so its effect and runtime availability are unknown. Do not recommend it as a working API without verifying a matching receiver and live behavior. [receiver unresolved; public API status needs review] Related: Terrain. doc:cs-bridge-receiveTriangles
  • window[name].getAtomPositionData — For an atoms object, asynchronously fills `atompositiondata` with comma-separated Unity world-space XYZ positions for all atoms, including a trailing comma. It does not synchronously return a JavaScript vector array; runtime behavior is unverified. Related: Vectors and Rotation Math. doc:cs-bridge-getAtomPositionData

Text

Navigation only. Read exact references before using a function. Search tasks: add dialogue bubble to a character, show timed speech above an object, attach text to an object's position, offset a character speech bubble, display object dialogue in a scene, hide a text message, clear a win message, show and hide on-screen text, show a goal-complete message, display temporary 3D text, show a win message in a game, add line breaks to on-screen text.

  • addSpeechBubble — Displays a timed speech bubble attached to an existing object, with a chosen package-defined bubble type and positional offset. Requires the SpeechBubbleManager and bundled assets; verify the integer type values before use. Related: User Interface Elements, Objects with Special Functions. doc:cs-bridge-addSpeechBubble
  • hideText — Hide the displayed on-screen text or goal message. Related: User Experience Design: Goals, Rewards, Quizzes, Surveys. doc:text
  • showText — Displays a temporary text message on screen, such as a goal or win message. Related: User Experience Design: Goals, Rewards, Quizzes, Surveys. doc:text · doc:sg · doc:forloop
  • updateSpeechBubble — Updates an existing speech bubble for a specified character; the bubble must already exist, and the text cannot contain commas. doc:cs-bridge-updateSpeechBubble

User Interface Elements

Navigation only. Read exact references before using a function. Search tasks: clear badges from a game interface, remove timed achievement badges, reset badge notifications between game rounds, manage badge feedback in a student game, resize speech bubbles, adjust chat bubble scale, speech bubble display size, configure in-scene conversation UI.

  • clearAllBadges — Cancels active badge timers and removes all badges managed by BadgeSystem; it does not clear the HTML game control panel. Related: User Experience Design: Goals, Rewards, Quizzes, Surveys. doc:cs-bridge-ClearAllBadges
  • speechBubbleManagerSize — Set the uniform local scale of an existing SpeechBubbleManager; this takes a numeric scale, not a screen-pixel size, and requires the manager to exist. Related: Chat. doc:cs-bridge-speechBubbleManagerSize

User Experience Design: Goals, Rewards, Quizzes, Surveys

Navigation only. Read exact references before using a function. Search tasks: hide a student goal badge, control badge visibility in a game, manage goal and reward displays, hide the goal_speedrun badge, show a game combo badge, display a fixed multiplier badge, demonstrate game reward UI, build game UI in the HTML control panel, show a reward when a player completes a goal, release coins above a game object, give players an object-based prize, add rewards to a learning game.

  • hideBadge — Hides the fixed goal_speedrun badge. The id argument is ignored, so it cannot reliably hide a badge chosen by name. [known limitation] doc:cs-bridge-HideBadge
  • showBadge — Displays a fixed demonstration badge reading “Combo!” and “Multiplier: 6x” for three seconds; it is not a configurable badge creator. [known limitation] Related: User Interface Elements. doc:cs-bridge-ShowBadge
  • youWin — Displays a reward message and releases a specified number of objects above a target when a game goal is reached. Related: Objects: Check back Weekly for new objects. doc:sg · doc:forloop

Vectors and Rotation Math

Review-only category: not a student capability recommendation.

Navigation only. Read exact references before using a function. Search tasks: .

  • getBonePosition — Intended to retrieve a named bone’s position, but the wrapper sends the wrong value and does not match Unity’s expected arguments; do not rely on it as a working bone query. [known limitation; public API status needs review] Related: Working with Meshes, IK Animation. doc:cs-bridge-getBonePosition

Integrate another javascript library into your project

Review-only category: not a student capability recommendation.

Navigation only. Read exact references before using a function. Search tasks: .

Internal helpers — not student API recommendations
  • addAssetDictionary — Registers metadata for a legacy asset bundle entry from a bundle name, item list, and URL; it does not download or load an asset. For game authoring, use the documented asset-loading workflow instead. Related: Loading and Positioning Objects. doc:cs-bridge-addAssetDictionary

Terrain

Navigation only. Read exact references before using a function. Search tasks: create a terrain for a game level, make an island or landscape, set terrain size and resolution, add terrain to a Unity scene, export terrain heightmap, save terrain data, read terrain surface layers, inspect terrain roads, terrain snapshot for a game scene, flatten terrain height, sculpt terrain to an elevation, reshape terrain around a point.

  • autoPaintTerrain — Automatically paint a terrain’s splatmap using grass, rock, and snow layers, with rock coverage based on slope and snow coverage based on elevation. Runtime availability is not verified. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • brushTerrain — Brushes terrain using a named terrain command and supplied options; available brush effects and option details are not established here. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • createGrass — Creates grass associated with a terrain using the supplied name and options. Runtime availability and supported options are not verified. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • createTerrain — Create a separate, initially flat terrain with a collider, ready for terrain editing. Supports optional placement and resolution settings; requires terrain runtime resources in the Unity player. api:createTerrain
  • exportTerrain — Read a complete terrain snapshot, including normalized heights, splat data, layer references, and roads, for saving through the movie-set pipeline. Texture image bytes are not included. Related: Water and paths. api:exportTerrain
  • flattenTerrain — Blend a terrain patch toward a target world-space elevation; the change affects terrain geometry but does not re-ground objects. api:flattenTerrain
  • generateTerrain — Replace the existing terrain heightmap with seeded Perlin hills; this overwrites prior sculpting, and existing objects do not move with the new terrain. api:generateTerrain
  • getTerrainInfo — Read an owned terrain’s position, dimensions, resolutions, texture layer count, and roads; use surface sampling for intentional height, slope, or normal measurements. api:getTerrainInfo
  • groundModel — Re-seat a registered scenery object on a named terrain by placing its bounding-box bottom at the sampled ground height, optionally aligning it to the terrain normal. Use after terrain sculpting; this is a one-time placement, not continuous terrain following. Related: Loading and Positioning Objects, Setting Position, Rotation and Scale After Loading. api:groundModel
  • hideFoliage — Hides a named Unity Terrain’s built-in trees and detail foliage by disabling its foliage drawing. It does not delete foliage instances, affect independently loaded GLB trees, or alter terrain height. doc:cs-bridge-hideFoliage
  • hideTerrain — A legacy JavaScript wrapper for a terrain-related Unity message. Its receiver is unresolved, so its effect and runtime behavior are unknown; do not rely on it without confirming the receiver and testing it. [receiver unresolved; public API status needs review] doc:cs-bridge-hideTerrain
  • listCSTerrains — Returns the names of terrains managed by the runtime; it does not include arbitrary Unity Terrain objects in the original scene. api:listCSTerrains
  • listObjectPaint — Lists scene objects identified as painted objects for the specified group. The wrapper filters the current scene state by a group-specific name prefix; runtime availability is unverified. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • loadTerrainHeightmap — Replace an existing terrain’s heights from a browser-accessible PNG or JPEG, using normalized red-channel values resampled to the terrain resolution. This replaces heights only; it does not re-ground scenery. Await the returned Promise before dependent commands. api:loadTerrainHeightmap
  • lowerTerrain — Lower existing terrain with a circular falloff brush; the centre is lowered by the requested amount, but terrain cannot drop below its origin Y. This changes geometry and does not re-ground objects. api:lowerTerrain
  • measurePlacement — Measure a registered scenery object's bounding-box relationship to terrain and, optionally, another registered scenery object. Use the results to review placement; this read-only check does not confirm mesh collision or support across the whole object. [public API status needs review] Related: Physics, Loading and Positioning Objects. api:measurePlacement
  • paintGrass — Places seeded grass within a radius on a terrain and returns the matching grass entry from environment state. [operation documentation needs review] No exact documentation anchor; review required.
  • paintObjects — Scatter copies of a source scene object across a terrain area, recording the generated object names under a group. The placement area is defined by x, z, and radius; count and seed control the scatter request. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • paintTerrain — Paint an existing terrain’s texture layer with a circular brush; this changes surface weights, not terrain geometry. api:paintTerrain
  • paintTerrainBySlope — Automatically paints a terrain by slope, using the selected ground and rock layers and the supplied slope threshold. [operation documentation needs review; public API status needs review] No exact documentation anchor; review required.
  • placeOnTerrain — Place an already loaded object's pivot at a one-time position on existing terrain, with an optional height offset. The operation does not make the object follow the terrain afterward. Related: Loading and Positioning Objects, Physics. api:placeOnTerrain
  • raiseTerrain — Raise an existing terrain area with a circular brush centered at the given world X/Z coordinates; terrain heights are clamped, and objects are not re-grounded. api:raiseTerrain
  • removeGrass — Remove a grass patch by name from the environment. The wrapper checks that a matching patch exists before requesting its removal; runtime availability is not verified. [operation documentation needs review] No exact documentation anchor; review required.
  • removeObjectPaint — Removes the scene objects associated with an object-paint group and returns the names removed. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • removeTerrain — Unload a named terrain and its collider and owned terrain assets; dependent scenery and grass must be removed or repositioned separately. api:removeTerrain
  • sampleTerrainHeight — Read the terrain’s world-space surface height at an X/Z position within its bounds; this is a read-only operation that returns a Promise. api:sampleTerrainHeight
  • sampleTerrainSurface — Read terrain surface data at an in-bounds world position: height, slope in degrees, and surface normal. Requires an existing prepared terrain and returns a Promise. api:sampleTerrainSurface
  • scatterObjects — Scatter 1–128 copies of a source object across a terrain, using terrain bounds and slope limits to place them with spacing. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • scatterSceneObjects — Clones a source scene object at seeded random positions within a terrain circle, filtering placements by slope, height, and spacing; grounds each clone and removes created clones if scattering fails. [operation documentation needs review; public API status needs review] Related: Objects: Check back Weekly for new objects, Loading and Positioning Objects. No exact documentation anchor; review required.
  • setTerrainColors — Replace a terrain’s layers with one to four solid colors, resetting its painted texture distribution to layer 0. api:setTerrainColors
  • setTerrainHeights — Set a rectangular patch of terrain heights using normalized values from 0 to 1, changing terrain geometry without moving separately placed objects. api:setTerrainHeights
  • setTerrainLayers — Replace a terrain’s material layers with texture or color settings. Replacing layers resets terrain painting to layer 0; wait for the returned Promise before dependent commands. api:setTerrainLayers
  • setTerrainSplatmap — Replace every terrain surface texture weight using a complete splatmap; this changes texture painting, not terrain height. api:setTerrainSplatmap
  • setTerrainTexture — Replace the texture on one existing terrain layer while preserving its painted distribution; optional normal-map and tile-size settings can be retained or changed. api:setTerrainTexture
  • setTerrainTextures — Replace all image-texture layers on a terrain, resetting terrain painting to layer 0. Use setTerrainTexture to change one layer while preserving painting. api:setTerrainTextures
  • setUpdateFieldFlag — Sets Unity’s existing legacy `updateFieldFlag` boolean; this controls legacy field-update machinery, not shared-memory updates or the new terrain API. [public API status needs review] doc:cs-bridge-setUpdateFieldFlag
  • showFoliage — Show existing trees and detail foliage on a named Unity Terrain by enabling its foliage drawing; this does not create or scatter foliage. doc:cs-bridge-showFoliage
  • showTerrain — Legacy wrapper targeting a terrain-related operation; its Unity receiver is unresolved, so its effect is unverified and it should not be recommended as a working command. [receiver unresolved; public API status needs review] doc:cs-bridge-showTerrain
  • smoothTerrain — Smooths a patch of an existing terrain toward neighboring heights using a 3-by-3 sample average with circular falloff. Changes terrain geometry but does not re-ground objects; await its Promise before dependent commands. api:smoothTerrain
Internal helpers — not student API recommendations
  • csTerrainCommand — Internal wrapper that forwards terrain commands to the Unity-side receiver; no specific terrain operation or student-facing use is documented. [operation documentation needs review] No exact documentation anchor; review required.

Water and paths

Navigation only. Read exact references before using a function. Search tasks: create an ocean or sea in a scene, set water surface dimensions, add water to a terrain environment, create a pond in a scene, add water to a landscape, set pond width and length, build a pool or lake environment, create a pool in a scene, set pool width and length, add water over a separate basin, build a pond or pool environment, lay a road over terrain.

  • createOcean — Create a named ocean water surface with optional width and length in metres. Water does not dig the seabed or add floating-object physics. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • createPond — Create a named pond with optional width and length in metres. The water surface does not dig a basin or add floating-object physics. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • createPool — Creates a named pool water surface with optional width and length in metres. The basin must be created separately; the water surface does not dig terrain or add floating-object physics. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • createSpline — Create a named river, road, or trail from route points, with an optional width; terrain-following is available for roads and trails. Runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Terrain. doc:water-and-paths
  • createWater — Request creation of a water feature from a name and options; options with a type are routed through surface creation. Runtime availability is not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • followPath — The wrapper is named `followPath`, but its Unity receiver is unresolved and its effect is unverified. Do not rely on it or call the raw Unity message as a workaround. [receiver unresolved; public API status needs review] Related: Objects with Special Functions. doc:cs-bridge-jFollowPath
  • followSplineTerrain — Set whether a named spline follows a terrain surface, with an optional vertical offset; documented for placing roads or trails on existing terrain without flattening it. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • gradeTerrainRoad — Request terrain grading for a specified road through the terrain command bridge; runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • paintTerrainRoad — Paints a terrain road along a sequence of X/Z points, optionally flattening the terrain along its route. The wrapper restricts routes to 2–256 points and widths up to 100; runtime availability is unverified. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • removeTerrainRoad — Request removal of a road from a terrain object using its name and road ID; runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • setSplineFlow — Set the flow speed of a named river spline; the documented wrapper rejects splines that are not rivers. [operation documentation needs review; public API status needs review] Related: Terrain. doc:water-and-paths
  • setSplinePoints — Set the control points for a named spline used as a river, road, or trail. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • setSplineWidth — Set the width of a named spline, such as a river, road, or trail. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • setSplineWidths — Set per-point widths for a named spline, such as a river, road, or trail. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • setTerrainRoad — Passes a road value for a named terrain through the JavaScript wrapper; the runtime contract and availability have not been reviewed. [operation documentation needs review; public API status needs review] Related: Terrain. No exact documentation anchor; review required.
  • setWaterDeepColor — Sets the deep color of a named water surface. The wrapper requires the newer Unity WebGL build capability and may reject the request if it is unavailable. [operation documentation needs review] Related: Scene. No exact documentation anchor; review required.
  • setWaterOpacity — Set a named water surface’s opacity and opacity falloff. The wrapper requires the newer Unity WebGL build’s water-opacity capability. [operation documentation needs review] Related: Scene. No exact documentation anchor; review required.
  • shapeWater — Set a water surface’s outline from a list of [x,y,z] points. Custom outlines can be concave; keep all points at the same height and do not repeat the first point at the end. The water does not dig the ground or create floating-object physics. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • sizeWater — Resize a named water surface by setting its width and length in metres; dimensions must be greater than zero. [operation documentation needs review] Related: Terrain. doc:water-and-paths
  • unFollowPath — Legacy wrapper for stopping an object from following a path, but its Unity receiver is unresolved and runtime behavior has not been verified. Do not recommend it as a working command. [receiver unresolved; public API status needs review] doc:cs-bridge-unFollowPath

Game Play and hidden outcomes

Navigation only. Read exact references before using a function. Search tasks: set dancer health, health field in a game, player health mechanics, game challenge outcomes.

  • reRun — Calls the legacy `clearRun()` routine when `reRun()` is invoked. The reset behavior and runtime availability are not established by the supplied evidence. [operation documentation needs review; public API status needs review] Related: Simulation Controls. doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans
  • setHealth — Sets the numeric health field on the prepared dancer. It does not add universal health behavior or define challenge win/loss rules. doc:cs-bridge-jsetHealth

Lighting

Navigation only. Read exact references before using a function. Search tasks: add a point light to a scene, set lamp color and brightness, place lights in a game environment, lighting for a 3D scene, add local reflections to a scene, make environment reflections around a building, update reflections after changing scenery, teach reflection probes and box projection, inspect scene lighting settings, read point lights and reflections, check environment lighting configuration, inspect post-processing settings.

  • createLight — Create or replace a named environment point light with a position, color, intensity, and range. Point lights do not cast shadows. Related: Scene, Visual Effects. api:createLight
  • createReflectionProbe — Create or replace a local reflection probe to capture nearby scenery for materials that support reflection probes. Recreate it after scenery changes to refresh the capture. Related: Scene. api:createReflectionProbe
  • createSceneLight — Create a named point light in the scene, passing its options to the environment command. Runtime availability is not verified. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • createSceneReflection — Requests creation of a named scene reflection probe with the supplied options. The receiver contract is unreviewed, so runtime availability is uncertain. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • getSceneLighting — Read the scene’s configured lighting state, including lights, reflections, and post-processing settings. This is read-only and returns a Promise; default values do not establish that lighting was explicitly configured. Related: Scene, Visual Effects. api:getSceneLighting
  • removeLight — Remove a recorded environment point light by name; completion is asynchronous, so await the returned Promise before dependent commands. Related: Scene. api:removeLight
  • removeReflectionProbe — Remove a named environment object intended to be a reflection probe. The wrapper does not verify the object's type, so use a known probe name. Related: Scene. api:removeReflectionProbe
  • setAmbientLight — Set the scene’s flat ambient fill-light color and intensity; this changes environment lighting and does not create a local light. Related: Scene. api:setAmbientLight
  • setBackgroundColor — Set the Main Camera background color using RGBA integer values from 0 to 255. For a solid-color background, disable the skybox with hideSky() first; this function does not disable it. Related: Cameras, Scene. doc:cs-bridge-setBackgroundColor · doc:cs-bridge-hideSky
  • setPostProcessing — Set global camera exposure, contrast, saturation, bloom, and vignette effects; requires URP post-processing support and replaces the runtime’s previous post-processing profile. Related: Cameras. api:setPostProcessing
  • setSceneFog — Requests a fog setting for the scene through the environment command; the receiver contract and runtime availability are unreviewed. [operation documentation needs review; public API status needs review] Related: Scene, Visual Effects. No exact documentation anchor; review required.
  • setSceneLighting — Sends a lighting command to the scene environment; runtime availability and supported settings are not verified. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • setSceneSky — Sets a scene sky using a URL and optional settings; runtime availability is unverified. [operation documentation needs review; public API status needs review] Related: Scene. No exact documentation anchor; review required.
  • setSunLight — Sets the scene’s directional sunlight color, intensity, pitch, and yaw, updating the existing sun or creating one if needed. Related: Scene. api:setSunLight
  • setSunShadows — Enable or disable shadows from the sun’s directional light and set their strength. Point-light shadows are not affected; appearance also depends on the URP renderer configuration. Related: Scene. api:setSunShadows
  • showSky — Enables the existing Skybox component on the Main Camera, switches to skybox clearing, and resets the background to transparent black. It does not load a skybox texture; the declared argument is unused. Related: Scene, Cameras. doc:cs-bridge-showSky

Image Loading and Scrolling

Navigation only. Read exact references before using a function. Search tasks: display an image overlay in a scene, position and size a screen image, scroll a loaded image, clear an image overlay after a duration, load an image from a CORS-accessible URL, load image URL as object texture, apply image to material base map, customize object appearance with a web image, use a student-created image on a 3D object.

  • LoadAndScrollImageOld — Legacy wrapper for an image-loading and scrolling operation, but its Unity receiver is unresolved; its effect and availability are unverified. Do not use it until the receiver is confirmed and tested. [receiver unresolved; public API status needs review] Related: Visual Effects. doc:cs-bridge-LoadAndScrollImage
  • loadImage — Load an image into a top-left-anchored screen overlay, position and size it on a 1920×1080 reference canvas, optionally scroll it, and clear it by duration or with an empty URL. It replaces the previous image canvas and has no completion callback. Related: User Interface Elements. doc:cs-bridge-loadImage
  • setMaterialBaseMap — Download a browser-accessible image URL into the first child Renderer’s material on a named object, setting its base map and resetting texture scale and offset. Requires an existing object and renderer; the wrapper returns no Promise. Related: Working with Meshes, Visual Effects. doc:cs-bridge-setMaterialBaseMap

Internal Stock Setup Callbacks

Review-only category: not a student capability recommendation.

Navigation only. Read exact references before using a function. Search tasks: .

Internal helpers — not student API recommendations
  • _csDisposeCarPrototypes — Internal cleanup helper that removes each registered car prototype; not a student-facing API. [operation documentation needs review] No exact documentation anchor; review required.
  • areAssetBundlesLoaded — Internal loading callback that checks registered asset bundles, updates their progress display, and starts the project after all bundles report loaded. Not a student-facing control for scenes, animations, or physics. [operation documentation needs review] Related: Loading and Positioning Objects. doc:cs-bridge-setScene · doc:cs-bridge-cancelLeans
  • atomsSetup — Loads and sets up an atom object using its name, position, and rotation; the available evidence does not establish more specific behavior. Related: Setting Position, Rotation and Scale After Loading. No exact documentation anchor; review required.
  • ballotboxdSetup — Internal setup callback for the ballot-box object; not a student-facing API. Available evidence only identifies its name, placement parameters, and a getBounds target. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • ballotboxrSetup — Internal setup callback for the ballot box object; it is not a student-facing operation. The available evidence does not show what setup it performs. No exact documentation anchor; review required.
  • barnSetup — Internal setup callback associated with the barn; available evidence does not establish a student-facing operation. No exact documentation anchor; review required.
  • basketball2Setup — Internal setup callback for the basketball2 object; the supplied evidence does not describe a student-facing operation. No exact documentation anchor; review required.
  • bballSetup — Sets up a basketball object; the available evidence does not specify setup details or effects. Related: Physics. No exact documentation anchor; review required.
  • bbcourtSetup — Sets up a basketball court object, with a name, position, and rotation; the available evidence does not clarify its exact setup behavior. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • bbhoopSetup — Internal setup callback for the basketball hoop object; not a student-facing API. No exact documentation anchor; review required.
  • boxSetup — Internal stock-object setup callback associated with bounds handling; not a student-facing API. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • cabinSetup — Loads and sets up a cabin object at the specified position and rotation; the available evidence does not clarify any further setup behavior. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • cannonballSetup — Internal setup callback for the cannonball object; not a student-facing API for loading or controlling cannonballs. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • cannonSetup — Internal setup callback associated with Cannon physics; not a student-facing API. No exact documentation anchor; review required.
  • catapultSetup — Set up a catapult object at a specified position and rotation; the available evidence does not establish what setup entails. Related: Loading and Positioning Objects, Physics. No exact documentation anchor; review required.
  • christmastreeSetup — Internal setup callback for the Christmas tree stock object; not a student-facing API. No exact documentation anchor; review required.
  • concreteSetup — Set up a concrete object using its name, position, and rotation; the associated evidence also references getting object bounds. Related: Loading and Positioning Objects, Setting Position, Rotation and Scale After Loading. No exact documentation anchor; review required.
  • cowboySetup — Internal setup callback for a stock cowboy actor; it is not a student-facing operation. No exact documentation anchor; review required.
  • dicerollingboardSetup — Internal setup callback for the dice-rolling board; not a student-facing API. No exact documentation anchor; review required.
  • diceSetup — Internal stock setup callback for a dice object; not a student-facing API. Related: Objects: Check back Weekly for new objects, Objects with Special Functions. No exact documentation anchor; review required.
  • dtrumpSetup — Internal stock-actor setup callback; not a student-facing API. Available evidence does not establish what setup work it performs. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • earthSetup — Appears to set up an Earth object using its name, position, and rotation; the available evidence does not specify what setup entails. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • ewarrenSetup — Internal setup callback for the ewarren object; it is not a student-facing API. No exact documentation anchor; review required.
  • fir1Setup — Internal setup callback for the fir1 stock object; not a student-facing API. Related: Objects: Check back Weekly for new objects, Loading and Positioning Objects. No exact documentation anchor; review required.
  • hclintonSetup — Internal setup callback for the H. Clinton stock actor; it is not a student-facing operation. No exact documentation anchor; review required.
  • horseSetup — Set up a named horse actor at the supplied position and rotation; the available evidence does not establish what additional setup it performs. No exact documentation anchor; review required.
  • jacobSetup — Sets up a stock actor named by `name` at the supplied position and rotation; the available evidence does not establish its exact setup behavior. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • jbidenSetup — Internal setup callback associated with the jbiden actor; it is not a student-facing API for loading or controlling the actor. No exact documentation anchor; review required.
  • jeepSetup — Initialize the stock CS Jeep so its vehicle-specific methods and expected wheel and steering joints are available. This setup applies only to a loaded stock Jeep, not an imported model shaped like one. Related: Physics, Joints. api:jeep.setSteering · api:jeep.setSpeed · api:jeep.getSpeed
  • jetpackSetup — Sets up a named jetpack object at the supplied position and rotation; available evidence does not specify its behavior or setup options. Related: Physics, Objects with Special Functions. No exact documentation anchor; review required.
  • madscientistlabSetup — Internal setup callback for the Mad Scientist Lab stock object; not a student-facing API. No exact documentation anchor; review required.
  • malberandjacobSetup — Internal stock setup callback; not a student-facing API. No exact documentation anchor; review required.
  • malberforcowboySetup — Internal setup callback for the cowboy actor; the evidence does not establish a student-facing operation. No exact documentation anchor; review required.
  • malberplusSetup — Internal setup helper associated with a stock object; available evidence does not establish a student-facing API or its specific behavior. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • malberSetup — Internal setup callback for the stock actor named `malber`; treat it as implementation detail, not a student-facing command. No exact documentation anchor; review required.
  • moonSetup — Internal setup callback associated with the moon object; not a student-facing API. No exact documentation anchor; review required.
  • opencrateSetup — Internal setup callback associated with the open-crate object; not a student-facing API. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • particlesSetup — Sets up a named particle effect with a position and rotation; the available evidence does not clarify its exact behavior. No exact documentation anchor; review required.
  • pendulumSetup — Appears to set up a named pendulum at a position and rotation; the available evidence does not establish whether students should call it directly. Related: Joints. No exact documentation anchor; review required.
  • penguin2Setup — Internal stock-object setup callback associated with bounds handling; not a student-facing API. No exact documentation anchor; review required.
  • penguinjrSetup — Internal stock-actor setup callback for the penguin; not a student-facing command. The available signature indicates it receives a name, position, and rotation. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • penguinSetup — Internal setup callback for the penguin stock object; not a student-facing API. No exact documentation anchor; review required.
  • picnicbenchSetup — Internal setup callback for a picnic bench; not a student-facing command for loading the object. No exact documentation anchor; review required.
  • pine1Setup — Internal setup callback for a pine object; the available evidence does not establish its full setup behavior. Not documented as a student-facing operation. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • playgroundSetup — Internal stock setup callback for a named playground object, with position and rotation parameters; not a student-facing API. No exact documentation anchor; review required.
  • presentSetup — Internal setup callback; available evidence does not establish a student-facing task or behavior. No exact documentation anchor; review required.
  • pushbuttonSetup — Internal setup callback for a pushbutton; treat as implementation infrastructure, not a student-facing API. Related: User Interface Elements. No exact documentation anchor; review required.
  • rampSetup — Internal setup callback for a ramp; the available reference only indicates a `getBounds` target, so its exact setup behavior is unclear. No exact documentation anchor; review required.
  • reindeerSetup — Internal setup callback for a reindeer stock object; available evidence does not establish its setup behavior. No exact documentation anchor; review required.
  • santahatSetup — Internal setup callback associated with the Santa hat stock object; not a student-facing API. No exact documentation anchor; review required.
  • sendModelListToUnity — Passes a list of model objects to Unity's ReceiveModelList target; the available evidence does not establish a student-facing use. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • sensorSetup — Appears to be an internal callback for setting up a sensor using its name, position, and rotation; the available evidence does not establish a student-facing API. No exact documentation anchor; review required.
  • skateparkSetup — Internal setup callback associated with a skatepark; the available evidence does not establish what it initializes. No exact documentation anchor; review required.
  • sleighSetup — Internal setup callback associated with a stock sleigh object; its exact setup behavior is not documented here. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • smokestackSetup — Internal setup callback for initializing a stock smokestack object; not a student-facing API. No exact documentation anchor; review required.
  • snowmanSetup — Internal setup callback associated with a snowman; not a student-facing API. No exact documentation anchor; review required.
  • soccerballSetup — Internal setup callback associated with the stock soccer ball; not a student-facing API. No exact documentation anchor; review required.
  • soccergoalSetup — Internal setup callback for a stock soccer-goal object; its signature includes a name, position, and rotation, and it references bounds information. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • soldierSetup — Internal setup callback associated with a stock soldier object; not documented as a student-facing API. No exact documentation anchor; review required.
  • spherebotSetup — Internal setup callback for the spherebot stock actor; not a student-facing API. Related: Objects: Check back Weekly for new objects. No exact documentation anchor; review required.
  • sphereSetup — Internal sphere setup callback that accepts a name, position, and rotation; its implementation and use are not shown. No exact documentation anchor; review required.
  • spinnerSetup — Internal setup callback associated with a spinner object; available evidence does not establish its behavior beyond its name and parameters. No exact documentation anchor; review required.
  • splitrailfenceSetup — Internal stock-setup callback for the split rail fence; its signature takes a name, position, and rotation. Not a student-facing API. Related: Loading and Positioning Objects. No exact documentation anchor; review required.
  • steveSetup — Internal setup callback associated with the Steve object; the available evidence does not establish its setup behavior beyond the name and getBounds target. Related: Objects: Check back Weekly for new objects, Loading and Positioning Objects. No exact documentation anchor; review required.
  • sunSetup — Appears to be an internal setup callback for a stock sun object, receiving its name, position, and rotation; the available evidence does not establish it as a student-facing API. Related: Lighting. No exact documentation anchor; review required.
  • telephonepoleSetup — Internal setup callback for a telephone-pole stock object; not a student-facing API. No exact documentation anchor; review required.
  • terrainSetup — Internal setup callback associated with terrain; the available evidence does not establish a student-facing operation. Related: Terrain. No exact documentation anchor; review required.
  • tophatSetup — Internal setup callback associated with the stock tophat actor; the available record does not establish a student-facing use. No exact documentation anchor; review required.
  • tubeSetup — Appears to be an internal setup callback for a tube object, using its name, position, and rotation; not established as a student-facing command. Related: Objects: Check back Weekly for new objects, Loading and Positioning Objects. No exact documentation anchor; review required.
  • universalSetup — Internal setup callback associated with the getBounds target; not a student-facing API. No exact documentation anchor; review required.
  • UpdateCanvasTexture — Internal demo plumbing that asks the hard-coded CanvasCube component to refresh its existing canvas texture; it does not accept a URL or object argument. doc:cs-bridge-updateCanvasTexture
  • voteSetup — Appears to be a stock-object setup callback; available evidence does not establish a student-facing use. No exact documentation anchor; review required.
  • warblerSetup — Internal setup callback for the stock warbler actor; the available evidence does not specify what setup it performs. No exact documentation anchor; review required.
  • wildwestSetup — Internal setup callback associated with the Wild West stock object; not a student-facing API. No exact documentation anchor; review required.
  • woodSetup — Internal setup callback for a stock wood object; not a student-facing API. No exact documentation anchor; review required.

Legacy recording and audio diagnostics

Review-only category: not a student capability recommendation.

Navigation only. Read exact references before using a function. Search tasks: .

  • stopRecording — Stops legacy animation and microphone recording, transfers serialized track 0 to JavaScript, and clears rerecording. This is not the modern AudioLab save-to-library flow; runtime behavior has not been verified. [public API status needs review] doc:cs-bridge-stopRecording
  • testAudioMorphsOn — Enables Unity’s legacy audio-morph testing flag; this is a diagnostic toggle, not a sound playback API or microphone permission request. [public API status needs review] doc:cs-bridge-testingAudioOn

Browser APIs and basic CS objects — October 16, 2026

Public browser-side functions are part of CS even when they do not send a Unity message. Legacy widgets remain compatibility-only.

Basic object operations

Basic CS object operations. These refer to loaded CS objects, not unpromoted scenery GLBs. Use objectname as the variable for your object. Whole-vector assignments use vector(); do not assign a plain {x,y,z} object.

Find an object by its registered name; make a vector; measure separation.
var objectname = find("penguin1");
var direction = vector(1, 0, 0);
var separation = distance(objectname.pos, otherobject.pos);

Place an object or change one position coordinate. Use for setup/reset, not repeated teleporting during physics motion.
objectname.pos = vector(0, 2, 0);
objectname.pos.x = 5;
objectname.setPosition(0, 2, 0);

Set rotation in degrees or change size.
objectname.rot = vector(0, 90, 0);
objectname.setRotation(0, 90, 0);
objectname.scale = vector(2, 2, 2);
objectname.setScale(2, 2, 2);

Place one loaded object relative to another using their bounds. Arguments are the other object's name, optional xyz offsets, optional xyz rotation offsets; omitted offsets are zero. This clears the moved object's linear/angular velocity; it does not attach or keep following. Use valid loaded bounds and inspect the result.
objectname.ontop("platform", 0, 0.2, 0);
objectname.onbottom("platform");
objectname.onleft("platform");
objectname.onright("platform");
objectname.infront("platform");
objectname.inback("platform");
ontop("penguin1", "platform", 0, 0.2, 0);

Change velocity or acceleration while physics moves the object. velocity aliases vel; angularVelocity aliases angvel. setVelocity/setAngularVelocity also notify prepared character components.
objectname.vel.x = 5;
objectname.vel = vector(5, 0, 0);
objectname.setVelocity(5, 0, 0);
objectname.acc = vector(0, 2, 0);
objectname.setAcceleration(0, 2, 0);
objectname.angvel = vector(0, 1, 0);
objectname.setAngularVelocity(0, 1, 0);

Set mass, friction or bouncing through CS. Do not change mass to hide a collision/attachment fault. Use setFriction to change the physics material, not the cached friction property.
objectname.mass = 2;
objectname.setFriction(0.5);
objectname.setElasticity(0.1);

Control gravity or hold an object during setup; release it for physics. freeze affects the root, not necessarily every body in a jointed machine.
objectname.gravityOff();
objectname.gravityOn();
objectname.freeze();
objectname.unfreeze();

Stop linear/angular velocity without moving the object; acceleration remains unchanged.
objectname.zerov();

CS object position, linear velocity and acceleration mirror Unity-world X; Y/Z agree. Negate X once when transferring a terrain/model/marker/raycast point into object.pos. Do not apply that rule blindly to Euler rotation. Keep physics bodies moving through forces/velocity, never timer-driven passenger position copying.

createKey

Bind keyboard press/release to named CS functions. Arguments: type "down" or "up", key name, function-name string (or CS code string). Arrow names: uparrow, downarrow, leftarrow, rightarrow; Space: spacebar. Bind once during setup. The page router forwards keys except while typing in text fields. No DOM keyboard listeners are needed. Do not duplicate characterController's built-in bindings.

function moveForward() {
    objectname.vel.z = 5;
}
function stopForward() {
    objectname.vel.z = 0;
}
createKey("down", "uparrow", "moveForward");
createKey("up", "uparrow", "stopForward");

removeKey

Remove a key binding. The current implementation can skip consecutive same-key bindings; do not assume repeated registrations are all removed. clearRun resets the game bindings.

removeKey("uparrow");

gameMouse

Enable pointer-lock request on a Game-canvas click, or disable/release it. A real user gesture is required; this does not grant AI testing control.

gameMouse(true);
gameMouse(false);

getGameMouse

Read mouse x/y normalized across the canvas, movement dx/dy, buttons bitmask and locked state. Reading consumes dx/dy; y increases upward.

var mouse = getGameMouse();

onGameMouseDown

Handle canvas mouse presses: button index and mouse state. Pass null to remove the callback.

function shoot(button, mouse) {
    if (button === 0) {
        fireWeapon();
    }
}
onGameMouseDown(shoot);
onGameMouseDown(null);

fireWeapon is your own game function.

createInterval

Run a named function every number of milliseconds. Register once; an existing function-name timer is not replaced. Use for checks/game logic, not repeatedly repositioning physics objects.

function checkDistance() {
    var separation = distance(objectname.pos, otherobject.pos);
}
createInterval("checkDistance", 100);

deleteInterval

Stop a timer made with createInterval.

deleteInterval("checkDistance");

createCountdownTimer

Call a named function once after a delay in milliseconds.

createCountdownTimer("endRound", 30000);

Define endRound in your game.

deleteCountdownTimer

Cancel a countdown before it fires.

deleteCountdownTimer("endRound");

startTimer

Start an elapsed-time clock under a unique name; it creates a global object with that name.

startTimer("raceClock");

getTimer

Read elapsed milliseconds from a named clock.

var elapsed = getTimer("raceClock");

stopTimer

Read elapsed milliseconds. Despite its name, this implementation does not stop or delete the clock.

var elapsed = stopTimer("raceClock");

setRepeat

Run a named check every interval in milliseconds. Named form allows independent handles; two-argument form uses the callback name as the handle. Define the callback first.

setRepeat("winCheck", "checkSolution", 500);
setRepeat("checkSolution", 500);

Choose one form, not both. Outcome checks belong in the hidden check section.

deleteRepeat

Stop the repeat with this handle.

deleteRepeat("winCheck");

deleteAllRepeats

Stop all registered repeat checks.

deleteAllRepeats();

solved

Report success from the hidden #begin/#end outcome-check section, after gameReady and your condition. The platform handles the attempt/coins; do not pass a fabricated key or put payout checks in editable player source.

solved();

lost

Report loss from the hidden #begin/#end outcome-check section, after gameReady and your condition. The platform handles the attempt/coins; do not pass a fabricated key or put payout checks in editable player source.

lost();

saveUI

Save the currently mounted modern UI by name through configured UI storage; await confirmation. Use after the current script.js has loaded, which replaces the older iframe saveUI definition. Keep loadUI in saved game setup.

await saveUI("driving-controls");

listUIs

List UI packages available through the configured storage service.

var interfaces = await listUIs();

hideUI

Temporarily hide the initialized game UI.

hideUI();

showUI

Show the initialized game UI again.

showUI();

clearGameUI

Clear the mounted modern UI and invalidate pending UI loads. clearRun already handles teardown. unloadUI is the same function.

clearGameUI();

subtractVec

Subtract vectors and return a new vector.

var offset = subtractVec(target.pos, objectname.pos);

multiplyVec

Multiply a vector by a number.

var faster = multiplyVec(objectname.vel, 2);

crossVec

Return the cross product of two vectors.

var normal = crossVec(direction, vector(0, 1, 0));

dotVec

Return the dot product of two vectors.

var alignment = dotVec(direction, otherdirection);

normalizeVec

Return a unit vector; zero input returns a zero vector.

var direction = normalizeVec(subtractVec(target.pos, objectname.pos));

addVec

Add vectors component by component and return a new vector.

var sum = addVec(a, b);

Color

Create an RGBA value for APIs that accept Color. Pass alpha explicitly; omitted alpha is zero. Use the consuming API’s channel range.

var color = Color(1, 0, 0, 1);

Rotation

Create an x/y/z/w quaternion for object.quat. Identity has w=1.

objectname.quat = Rotation(0, 0, 0, 1);

eulerToQuaternion

Convert Euler degrees using the CS ZXY order to a quaternion.

var rotation = eulerToQuaternion(vector(0, 90, 0));

quaternionToEuler

Convert a quaternion object that implements toEuler to the library’s Euler result; a bare Rotation value does not implement that method. Prefer objectname.rot for ordinary CS rotations.

var angles = quaternionToEuler(quaternionWithToEuler);

setRotationType

Select the legacy rotation synchronization representation: euler or quaternion. Preserve the current project mode unless deliberately changing its representation.

setRotationType("euler");

log

Write a value to the CS message output.

log(objectname.pos.y);

showPage

Show the existing legacy page overlay. It must already contain the intended content; this does not create a modern game UI.

showPage();

hidePage

Hide the existing legacy page overlay. It must already contain the intended content; this does not create a modern game UI.

hidePage();

refreshWater

Refresh an existing water surface through updateWater with an empty patch.

await refreshWater("ocean");

removeCollisionWatch

Remove a registered collision watcher by its stored identifier. The key concatenates object1 name + child1 path + object2 name + child2 path (empty paths when omitted).

removeCollisionWatch("penguin1" + "platform");

getCar

Get the managed car instance. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

var result = getCar("car1");

listCars

List managed cars. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

var result = listCars();

getCarState

Read sampled managed car state. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

var result = getCarState("car1");

setCarControls

Drive a managed car with normalized controls. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

setCarControls("car1", {throttle: 0.3, steering: 0, brake: false});

setCarSuspension

Change managed-car suspension. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

setCarSuspension("car1", {spring: 10000, damping: 700});

resetCar

Reset the managed car assembly. These operate on createCar assemblies, not stock jeeps. See the car reference for the complete configuration.

resetCar("car1");

objectname.zero

Reset position, rotation, velocity, acceleration and angular velocity to zero; leaves scale unchanged. Origin may be inside the ground, so this is not a safe spawn placement.

objectname.zero();

objectname.zeroall

Reset position, rotation and motion to zero and restore original scale. Place safely above support afterward.

objectname.zeroall();

objectname.zeros

Restore original scale only.

objectname.zeros();

objectname.zeroprs

Reset position/rotation to zero and restore original scale; motion is unchanged. Place safely above support afterward.

objectname.zeroprs();

objectname.animateRotate

Rotate using the existing CS rotatephysics animation route. Arguments: xyz, duration, optional callback and parameter; use the animation guide for timing/coordinate behavior.

objectname.animateRotate(0, 90, 0, 2);

objectname.friction

This JavaScript property holds a cached number; assignment alone does not call the material receiver. Set actual physics friction through the public method.

objectname.setFriction(0.5);

addAssetDictionary

Register an existing bundle catalog entry using name^items^path. This registers metadata; it does not download, package or promote a GLB. Use actual prepared bundle values.

addAssetDictionary(bundleName + "^" + itemNames + "^" + bundleUrl);

javascriptControlOn

Enable JavaScript synchronization for an already registered object. This is not a switch to replace normal physics motion.

javascriptControlOn("objectname");

socketStartCCD

Start prepared dancer CCD using the exact bone path. This pauses existing legacy animation; do not use it merely to wield a weapon on a dancer with working goals.

socketStartCCD({name: "objectname", jointname: bonePath});

updateFieldPositions

Update positions by index in an already initialized shared field. Match the field instance count/order; these are not named CS-object or foliage-scatter operations.

updateFieldPositions([vector(0, 2, 0)]);

updateFieldRotations

Update rotations by index in an already initialized shared field. Match the field instance count/order; these are not named CS-object or foliage-scatter operations.

updateFieldRotations([vector(0, 90, 0)]);

updateFieldScales

Update scales by index in an already initialized shared field. Match the field instance count/order; these are not named CS-object or foliage-scatter operations.

updateFieldScales([vector(2, 2, 2)]);

updateFieldColors

Update colors by index in an already initialized shared field. Match the field instance count/order; these are not named CS-object or foliage-scatter operations.

updateFieldColors([Color(1, 0, 0, 1)]);

createButton

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createButton(name, title, downfunction). Define any named callback before creating the widget.

createButton("jumpButton", "Jump", "jump");

createMomentary

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createMomentary(name, title, downfunction, upfunction). Define any named callback before creating the widget.

createMomentary("jet", "Jet", "jetOn", "jetOff");

createToggle

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createToggle(name, title, upfunction, downfunction). Define any named callback before creating the widget.

createToggle("jet", "Jet", "jetOff", "jetOn");

createSlider

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createSlider(name, title, functionname, low, hi, step, defaultValue, bounce). Define any named callback before creating the widget.

createSlider("power", "Power", "setPower", 0, 10, 1, 5, false);

createHtmlButton

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createHtmlButton(name, title, functionname). Define any named callback before creating the widget.

createHtmlButton("jumpButton", "Jump", "jump");

createHtmlButtonWithInput

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createHtmlButtonWithInput(name, title, functionname, initialvalue). Define any named callback before creating the widget.

createHtmlButtonWithInput("power", "Power", "setPower", 5);

createImage

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createImage(name, src). Define any named callback before creating the widget.

createImage("picture", imageUrl);

createTitle

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createTitle(name, txt). Define any named callback before creating the widget.

createTitle("title", "Gravity");

createText

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createText(name, text). Define any named callback before creating the widget.

createText("instructions", "Press Space to jump");

createSelect

Legacy select widget; implementation references undeclared options instead of optionarray. Do not introduce new uses; use a modern UI select and registered command. Existing callers may depend on a global options value.

createMeter

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createMeter(name, title, watch, howoften). Define any named callback before creating the widget.

createMeter("height", "Height", "objectname.pos.y", 500);

createPoints

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createPoints(name, title, xpoint, ypoint, howoften). Define any named callback before creating the widget.

createPoints("path", "Path", "objectname.pos.x", "objectname.pos.y", 500);

createChart

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createChart(name, title, xpoint, ypoint, howoften, xlow, xhigh, xdivs, ylow, yhigh, ydivs). Define any named callback before creating the widget.

createChart("path", "Path", "objectname.pos.x", "objectname.pos.y", 500, 0, 10, 5, 0, 10, 5);

createHelp

Legacy UI compatibility only; preserve when maintaining old challenges. For new interfaces use previewUI/registerUICommands. createHelp(name, title, content). Define any named callback before creating the widget.

createHelp("help", "Help", "Press Space to jump");

GPU programs and connected scientific surfaces

WebGPU preview version 6. Check typedPrograms and runtimeWGSL in getGPUCapabilities(). The calculation and deformation stay on the GPU. These tools support custom solvers; they do not automatically supply one.

createGPUProgram

createGPUProgram(name,buffers): v6 Promise. Create named typed f32/u32 GPU buffers, count and components, optional values/integers arrays, units and grid/stagger metadata. 1..24 buffers, four programs,128MiB typed budget. Read GPU_PROGRAMS.txt. Does not provide a built-in solver.

compileGPUProgram

compileGPUProgram(name,passes): v7 Promise. Up to32 ordered passes {name,count,bindings:[{name,buffer,access:"read"|"write"|"atomic"}],source}. Atomic requires u32 and exposes array<atomic<u32>>. Source defines fn update(i:u32); params count/dt/time/step supplied. No implicit snapshots or aliases; separate neighbor dependencies into passes. Atomic replacement. Read GPU_PROGRAMS.txt.

runGPUProgram

runGPUProgram(name,dt,speed=1,maxSteps=16): v6 Promise. Fixed timestep, speed <=10, step budget <=256 per frame. Caller must choose solver-stable dt; overloaded simulation slows rather than enlarging dt.

pauseGPUProgram

pauseGPUProgram(name): v6 Promise. Stop repeating passes, preserving all GPU state.

stepGPUProgram

stepGPUProgram(name,dt,steps=1): v6 Promise. Paused only, 1..256 ordered steps. Await GPU completion. Static solver iterations are not physical simulation time.

getGPUProgramState

getGPUProgramState(name): v6 Promise. Typed program bytes,bufferCount,compiled,running,time,dt,steps,speed,maxSteps,skippedWallSeconds.

measureGPUBuffer

measureGPUBuffer(name,buffer,offset=0,count=1): v6 Promise. Read 1..1024 scalar entries from an actual GPU buffer. Returns values for f32 or integers for u32. One pending probe per program; sparse measurements only.

removeGPUProgram

removeGPUProgram(name): v6 Promise. Dispose typed buffers, kernels and connected surface. clearRun also clears programs. Recreate saved recipe to reset; exact state resume not yet implemented.

showGPUSurface

showGPUSurface(name,positions,triangles,field,vertices,triangleCount,options={}): v6 Promise. Shared xyz f32 positions, u32 triangle indices and f32 field per vertex. options min/max/extent/grid. Live GPU deformed surface, blue-white-red legend must be supplied by UI. Surface edges are not necessarily numerical volume elements. No deforming PhysX collider. Version7 adds options.style="glass" for a translucent shell; this does not create collision geometry.

Buffer layout, WGSL contract and limits · Beam Bending example · FDTD Waves example

Beam Bending uses a static, small-deflection Euler–Bernoulli beam. FDTD Waves uses a normalized periodic Yee grid. Both have analytical/discrete reference measurements and separate activities. Arbitrary-mesh soft-body contact and FDTD absorbing boundaries are future work. A generated-block collision recipe is documented below.

GPU soft-body collision example

Use the existing typed GPU program tools for a 3D compressible elastic block with an analytic floor. The complete activity includes slow motion, pause, stepping, reset, viewpoints, surface triangles and von Mises stress colors. Equations, buffer layout, validation and limits. Motion and stress are calculated on the GPU. This recipe does not add soft-body collision to ordinary CS objects.

GPU liquid surfaces

showGPUFluid

showGPUFluid(name,positions,count,radius,options={}): v11 Promise. Draw a smooth liquid surface from an existing xyz f32 GPU buffer in MainCamera; does not simulate water. count equals buffer count. radius is visual support in world units, not particle mass/contact radius. options: anisotropy true (neighbor-aware ellipsoids; false uses spherical kernels), smoothing .5..6 (3), smoothIterations 1..4 (2), tint {x,y,z} linear RGB 0..1, absorption {x,y,z} nonnegative inverse-length RGB coefficients (3,.65,.25), roughness 0..1 (.12), ior 1..3 (water 1.333), refraction 0..1 (.12), resolution .25..1 (.75), opacity 0..1 (1), particles false, extent. Repeating the call changes appearance without resetting fluid. Check fluidOptics. particleVolume is per-particle volume in cubic world units (mass/restDensity); 0 retains legacy thickness. V11 adds normalized thickness, IOR-based refraction and GGX highlights. Read FLUIDS.txt and pouring-water.js.

await showGPUFluid("water", "positions", 1200, 0.018, {resolution: 0.75, smoothing: 4, smoothIterations: 3, absorption: {x: 3, y: 0.65, z: 0.25}});

Check version11, fluidOptics, fluidAnisotropy, gpuFluidSurface and atomicProgramBuffers in getGPUCapabilities(). Fluid guide and numerical limits · Complete Pouring Water recipe. The particle solver and surface renderer are separate; this does not add fluids to ordinary CS rigidbodies.

Geometrical and wave optics on the GPU

Use drawOpticalRays for rays through multiple mathematical optical surfaces, renderOpticalImage for flat-source projection, and createOpticalLens for live views through a glass sphere at Unity objects. These are distinct models.

The reusable makeWaveOptics recipe supplies a two-dimensional Maxwell solver with refractive-index, absorption, conductor/aperture and coherent-source maps. Its GPU probes measure average squared electric field and energy flux. Run it using the existing typed GPU program commands; include the recipe in saved editor code. It is not a new preinstalled browser function.

Choose the right optics model · Wave settings and measurements · Reusable wave recipe

Verified in Unity and Chrome WebGPU. Requires WebGPU typedPrograms. Full 3D wave optics, coupled live multi-lens images and automatic wave/ray coupling are not yet implemented.

Live GPU tools and physics-driven ropes

Full contracts and examples. Requires WebGPU engine version12; query getGPUCapabilities first.

updateGPUBuffer

updateGPUBuffer(program,buffer,values,offset=0): Promise. Write up to4096 finite f32/u32 scalars to existing shared GPU state. Scalar offset (xyz point4 starts at12). Does not recreate/compile/reset the program. Read GPU_TOOLS.txt; v12 liveBufferTools.

copyGPUBuffer

copyGPUBuffer(program,source,destination,options={}): Promise. GPU-to-GPU copy within one program, distinct buffers of same scalar type. options offset=0,destinationOffset=0,count=source remainder. Pause for consistent multi-buffer reset; does not reset clock/RNG or save a project checkpoint. v12 liveBufferTools.

fillGPUBuffer

fillGPUBuffer(program,buffer,value,options={}): Promise. GPU fill of scalar range, options offset=0,count=remainder. f32 finite/u32 unsigned integer. Does not recompile. v12 liveBufferTools.

summarizeGPUBuffer

summarizeGPUBuffer(program,buffer,options={}): Promise. f32 GPU sum/minimum/maximum, validCount/invalidCount; offset=0,count=remainder. Skips NaN/Infinity; all-invalid returns zeros. Float32 approximate reduction. Reads only compact aggregate partials. v12 gpuQueries.

findNearestGPUPoint

findNearestGPUPoint(program,positions,{x,y,z}): Promise. f32 components3 world xyz. Returns index,distance; equal-distance ties use lowest index; no valid point returns -1,-1. Point proximity, not mesh raycast. v12 gpuQueries.

countGPUPointsInSphere

countGPUPointsInSphere(program,positions,{x,y,z},radius): Promise. f32 components3 world xyz. Returns matches including sphere boundary. Radius0..100000; ignores nonfinite points. v12 gpuQueries.

showGPUTube

showGPUTube(program,positions,options={}): Promise. 2..256 f32 xyz points. options radius=.05,sides=8 (3..16),extent=100,tint={x:.65,y:.4,z:.18} linearRGB0..1. One tube/program; GPU generated open tube, stable transported frames, simple lit woven material. No Rigidbody/joints/colliders/forces. Read GPU_TOOLS.txt; v12 gpuTubes.

trackGPURope

trackGPURope(program,positions,objectNames): Promise. After showGPUTube, follow one existing named object per point. Read-only physical anchors; does not move/freeze/parent/change joints. [] detaches. Removed anchor detaches whole chain. Do not also run a kernel writing tracked positions. Freeze/place/createJoint/configure/unfreeze using normal CS commands. v12 gpuTubes.

styleGPUTube

styleGPUTube(program,options={}): Promise. Change only supplied radius or tint{x,y,z} on existing tube, preserving path and physics. Radius(0,100], tint linearRGB0..1. v12 gpuTubes.

estimateGPUProgram

estimateGPUProgram(buffers): Promise. Same f32/u32 specs as createGPUProgram. Returns bytes,remainingBytes after proposed allocation in128MiB typed budget; validates four-program limit without allocating. Excludes render scratch/textures; does not reserve capacity. v12 liveBufferTools.

Editable GPU meshes

Contracts and examples. Requires gpuMeshEditing on the loaded WebGPU player.

createGPUMesh

createGPUMesh(name,shape,options={}): Promise. Creates grid (XZ), sphere or box with fixed topology in shared GPU program buffers. options size{x,y,z},origin{x,y,z},resolution2..64, style options. Returns vertices,triangleCount,pivot. Use GPU_MESHES.txt; v13 gpuMeshEditing.

importGPUMesh

importGPUMesh(name,objectname,options={}): Promise. Copies readable static MeshFilter meshIndex0/submesh0 into world-space GPU buffers, selected UV/base texture/color. Source object/collider untouched. Max65536 vertices/131072 triangles. Not skinned animation or full material import. Read GPU_MESHES.txt.

deformGPUMesh

deformGPUMesh(name,type,amount,options={}): Promise. Geometry from rest: stretch factor, twist rad/unit, bend curvature1/unit, inflate/wave amplitude world units. axis x/y/z default y; optional pivot,wavelength,phase. Applies weights mask, updates normals. Not a physics solver or cumulative stack.

maskGPUMesh

maskGPUMesh(name,center,radius,options={}): Promise. Radial rest-position weights. feather0..1 default.5,invert false. Weight0 pins/rest,1 fully deforms. Call deformation after mask. fillGPUBuffer(name,"weights",1) clears mask.

showGPUMesh

showGPUMesh(name,options={}): Promise. Lit GPU mesh style: tint RGB,metallic0,smoothness.35,checker0,grid false,extent100,autoNormals true. Complete style settings not partial patch. Copies base texture/UV; opaque, double-sided, receives main light shadows, no shadow casting.

refreshGPUMeshNormals

refreshGPUMeshNormals(name): Promise. GPU area-weighted normals from fixed topology/adjacency. Automatic each frame by default; disable via showGPUMesh autoNormals:false for static geometry or supplied normals. Do not modify adjacency/triangles.

resetGPUMesh

resetGPUMesh(name): Promise. Restore rest positions/normals, keep weights/style/topology. Pause running kernels first. Not clock/RNG checkpoint. removeGPUProgram disposes whole mesh.

GPU mesh queries and selection

Contracts and examples. Requires gpuMeshQueries on the loaded WebGPU player.

getGPUMeshBounds

getGPUMeshBounds(name): Promise. Current GPU mesh boundsMin,boundsMax,pivot,validCount,invalidCount. Deformed positions, not original shape. Invalid vertices excluded; zero valid means no real bounds. Requires gpuMeshQueries v14. Read GPU_MESH_SELECTION.txt.

raycastGPUMesh

raycastGPUMesh(name,origin,direction,options={}): Promise. Nearest ray/triangle hit against this editable GPU mesh. options maxDistance10000,backfaces true. Direction normalized. Returns hit,index,distance,point,geometric normal,UV,barycentric. Miss hit=false/index=-1/distance=-1. Unity-world coordinates. No PhysX response. Read GPU_MESH_SELECTION.txt.

closestGPUMeshPoint

closestGPUMeshPoint(name,point,options={}): Promise. Nearest point on current triangles including edges/corners. maxDistance default10000; returns same hit fields as raycastGPUMesh. Unsigned distance, not penetration/inside classification. One query per program at a time; scan not BVH.

paintGPUMeshMask

paintGPUMeshMask(name,center,radius,weight,options={}): Promise. Edit local vertex weights0..1. mode replace/add/subtract,feather0..1 default.5,space rest/current default rest. Outside brush unchanged. Call deformGPUMesh next. Current-space brush can use a ray hit point. Read GPU_MESH_SELECTION.txt.

maskGPUMeshBox

maskGPUMeshBox(name,center,size,options={}): Promise. Replace all weights using axis-aligned box full dimensions. feather0..1 default.25,invert false,space rest/current default rest. Apply deformation next; zero-weight vertices remain at rest.

maskGPUMeshPlane

maskGPUMeshPlane(name,point,normal,options={}): Promise. Replace all weights using positive half-space of normalized plane. feather is world-unit centered transition band default0,invert false,space rest/current default rest. Apply deformation next.

GPU physics bridge

Contracts and examples. Requires gpuPhysicsBridge on the loaded WebGPU player.

enableGPUMeshPhysics

await enableGPUMeshPhysics(meshName, settings={}) — attach the GPU linear-elastic triangle network and contact solver to an editable GPU mesh. Optional yieldStrain and plasticCreep must both be positive to allow permanent plastic rest-shape flow; leave both zero for elastic-only motion. Existing CS rigidbodies can couple through addGPUCollider. This is not fracture, dynamic topology, or collider editing on the source mesh. See GPU_DEFORMATION.txt. Browser rigidbody impact is experimental: current deep-overlap failure excludes this spring sheet as a reliable blocking game surface. GPU sculpting and the separate GPU beam have their own acceptance results.

enableGPUParticlePhysics

enableGPUParticlePhysics(name,radius,settings={}): Promise. Native GPU particle integration on initial f32 xyz positions/velocities buffers, <=8192. Analytic obstacles and CS spheres/boxes, gravity/drag/bounce/friction. Optional self-collision via setGPUParticleContacts (v18). Total particle mass <=1/4 dynamic body mass. No CS object per particle. Read GPU_PHYSICS.txt.

addGPUCollider

addGPUCollider(name,objectname): Promise. Register loaded sphere/box/capsule colliders. Preserves CS physics, mass, constraints/interpolation. Capsule particle sweeps are analytic; elastic-sheet capsules use <=32 sampled spheres. Max16 shapes/64 samples. Static mesh/terrain use addGPUSceneCollider. v16.

removeGPUCollider

removeGPUCollider(name,objectname): Promise. Unregister CS participant or analytic obstacle; invalidate pending contacts, restore imported-source collision pair ignores. CS object itself stays.

addGPUObstacle

addGPUObstacle(name,id,shape,settings={}): Promise. GPU particle analytic plane/sphere/box; position{x,y,z}, size full{x,y,z}, normal default up, radius default1. No rendered object is created. Render matching geometry separately. Unity world coordinates.

setGPUPhysics

setGPUPhysics(name,settings): Promise. Patch stiffness,foundation,damping,friction,bounce,gravity,thickness,substeps. Mass/pinBoundary fixed at creation. Invalid or unstable settings rejected. Solver owns positions and velocities; do not run/write a second compute solver.

pauseGPUPhysics

pauseGPUPhysics(name): Promise. Pause GPU integration/contact response. Does not freeze CS bodies. Use ordinary CS freeze during setup only if required.

startGPUPhysics

startGPUPhysics(name): Promise. Resume GPU integration/contact response.

resetGPUPhysics

resetGPUPhysics(name): Promise. Restore GPU positions and velocities to initial state; clear pending contacts/generation. Keeps registration, settings and running state. Reset CS participants separately once, not every frame.

getGPUPhysicsState

getGPUPhysicsState(name): Promise. Returns physics{mode,running,pending,steps,simulatedTime,bodies,samples,contacts,generation,latency,dropped,readbackBytes,error}, physicsSettings. Latency in seconds. Summaries only; actual geometry stays GPU-side. v16 adds sceneryTriangles,sceneryNodes,triangleTests,eventQueue,eventOverflow. triangleTests counts last particle batch candidates across substeps, not GPU timing.

getGPUContacts

getGPUContacts(name): Promise. Latest contacts[]{other,collider,phase,point,normal,impulse,triangle,barycentric,separation,age}. Mesh enter/stay/exit, actual current triangle; impulse on CS body. Particle records aggregate per obstacle (triangle=-1, no single normal). Not guaranteed event log; legacy collisionWatch unchanged. No JS force loop.

showGPUPhysicsEnergy

showGPUPhysicsEnergy(name,maximum=1): Promise. Color editable physics mesh by per-node elastic energy in joules, with triangle lines. Not stress in pascals. No particle mode.

GPU scenery collision

Contracts and examples. Requires gpuSceneryCollision on the loaded WebGPU player.

addGPUSceneCollider

addGPUSceneCollider(name,objectname): Promise. GPU particles collide with existing static readable MeshCollider/TerrainCollider. Captures world triangles + BVH. No Rigidbody permitted. <=65536 triangles/collider; terrain129 fits;257 rejected. Refresh explicitly after edits. Does not create/render scenery. Read GPU_SCENERY.txt. Requires gpuSceneryCollision.

refreshGPUSceneCollider

refreshGPUSceneCollider(name,objectname): Promise. Refresh registered terrain/static mesh snapshot after editing. Transactional; errors retain old snapshot. Transform changes pause solver; refresh then startGPUPhysics. In-place vertex/height edits require explicit refresh.

setGPUContactEvents

setGPUContactEvents(name,settings={}): Promise. Configure bounded event queue: other exact object name (default all), minimumImpulse N·s (default0), stay false. Clears current queue/episodes. Threshold admits episode; corresponding exit retained. Read GPU_SCENERY.txt.

getGPUContactEvents

getGPUContactEvents(name,maximum=64): Promise. Drain1..256 retained aggregate collider events in reply.events. Fields sequence,step,other,collider,phase,point,impulse,normal,triangle. Particle contacts have averaged point, no unique triangle/normal. Queue256, oldest-drop overflow reported in physics.eventOverflow. Single consumer. Reset/pause/registration clear queue. For UI/audio/scoring, not force loops. Requires gpuContactEvents.

GPU instance rendering

Material, transform and visibility examples. Requires instanceMaterials on the WebGPU player.

styleGPUInstances

await styleGPUInstances(name, settings={}) — enable/patch optional lit instance renderer for billboard/sphere/box/custom. Settings: tint/emission Vector3, lit, metallic, roughness, normalStrength, tiling/offset Vector2, surface opaque/cutout/transparent/additive, opacity/cutoff, castShadows/receiveShadows, enabled, frustumCulling, maxDistance, lodDistance/farDistance, lodMesh/farMesh, shadowDistance. Old64-byte particle layout retained. Call before compileGPU to expose optional styles binding4; see GPU_RENDERING.txt. Requires instanceMaterials.

setGPUInstanceTransforms

await setGPUInstanceTransforms(name, entries, offset=0) — setup per-instance {rotation:{x,y,z} degrees,scale:{x,y,z} positive,emission:1}. Name must be styled first. Keep each JSON command under100K characters. Animate populations with GPU styles instead of per-frame JS uploads. Requires instanceTransforms.

setGPUInstanceTexture

await setGPUInstanceTexture(name, slot, url) — PNG material texture for styled collection. slot albedo (sRGB), normal (linear RGB tangent normal), metalRough (linear metallic R/roughness G). Direct HTTPS/same-origin URL, CORS, no redirects, <=4MiB, <=2048x2048. Maps multiply scalar material values. Failure preserves old texture. Requires instanceMaterials.

getGPURenderState

await getGPURenderState(name) — renderSettings and render diagnostics: visible/near/medium/far/shadowCasters, visibleTriangles/shadowTriangles, bufferBytes/meshBytes/textureBytes, sampled/pending/error. On-demand asynchronous counts, initial report may be unsampled; poll later. These are per-collection estimates, not total FPS/Unity memory. Requires instanceLOD.

GPU particle contacts

Particle, deformable and rigidbody examples. Requires gpuParticleContacts on the WebGPU player.

setGPUParticleContacts

await setGPUParticleContacts(name, settings={}) — Enable GPU sphere-to-sphere contacts on an enableGPUParticlePhysics program. settings: enabled, lower/upper world xyz bounds, cellSize (at least twice largest radius), iterations1..8. Grid at most1048576 cells. Set bounds before running. Capacity8192 particles unchanged. Discrete substepped contacts; not fluid or swept particle-particle CCD. Read GPU_PARTICLE_CONTACTS.txt.

setGPUParticleProfiles

await setGPUParticleProfiles(name, profiles) — Assign selected particles by index, radius, mass, group0..15, mask0..65535. Each entry is a complete profile; defaults radius.1, mass.01, group0, mask65535. Applies atomically. showGPUParticles follows physical radius automatically; other renderers must be sized separately. Do setup paused. Ordinary CS Rigidbody coupling still requires total particle mass <= one-quarter body mass.

excludeGPUParticlePairs

await excludeGPUParticlePairs(name, pairs) — Replace up to1024 explicit noncolliding particle pairs [{a:0,b:1}]; empty list restores them. Does not disable contacts with CS colliders or other programs. Group masks apply only to self-contact in this collection.

attachGPUDeformable

await attachGPUDeformable(name, meshProgram) — Couple a GPU particle program to a separate enabled GPU physics mesh. GPU-only barycentric impulses and positional correction deform its oriented linear-elastic triangle sheet. One particle program per sheet; limit2097152 particle-face and particle-vertex tests per substep. The particle solver advances the sheet while attached. Pause/reset both for replay. This is not a large-deformation cloth or fluid solver.

detachGPUDeformable

await detachGPUDeformable(name) — Detach a particle program's GPU mesh coupling; preserve the sheet and its current shape/velocity. Removing either program also detaches safely.

getGPUParticleState

await getGPUParticleState(name) — Read particleDiagnostics: enabled,sampled,pending,particles,cells,pairs,candidateTests,maxOccupancy,maxOverlap,outside,overflow,substepTravelRadii,dispatchMilliseconds,deformable; physics contains running/error. Async diagnostics, first result can be unsampled. 32-byte periodic health readback pauses on grid escape or traversal overflow. dispatchMilliseconds is CPU submission time, not GPU timing. Read once/second rather than every frame.

showGPUParticles

await showGPUParticles(name, settings={}) — Draw enabled GPU physics particles as lit spheres using their live radius and position, entirely GPU-to-GPU. settings supports tint, colorByGroup (blue even groups/orange odd), roughness, metallic, shadows and LOD material controls. Does not create rigidbodies or modify physics. Use instead of showGPUFluid for solid granular particles. Default blue. Size follows setGPUParticleProfiles.

GPU volumes and fields

Field coordinates, colors and examples. Requires gpuVolumeFields on the WebGPU player.

showGPUVolume

showGPUVolume(name, buffer, settings={}) — Ray-march a regular 3D f32 scalar field or vector magnitude. Buffer nx/ny/nz 2..128, exact count=nx*ny*nz <=1048576, components1 or3; x fastest. spatialOffset=world lower node, spacing=node distances. Settings min/max, density0..100, samples8..256, stops:[{at:0..1,color:{r,g,b,a}}] (2..8 ordered stops covering0..1), visible, clip/clipPoint/clipNormal. One field view per program; showing another replaces it. Uses existing buffers, no new solver. gpuVolumeFields required.

showGPUFieldSlice

showGPUFieldSlice(name, buffer, settings={}) — Display a 3D field on a movable plane: slicePoint:{x,y,z}, sliceNormal:{x,y,z}, min/max, density, stops. Same regular-grid layout and color mapping as showGPUVolume. Only the plane inside field bounds is shown. Scalar value or xyz vector magnitude.

showGPUVectorField

showGPUVectorField(name, buffer, settings={}) — Arrows from a regular xyz vector field. Same grid metadata as showGPUVolume, components3 required. stride>=1 samples grid nodes; <=32768 arrows. glyphLength is maximum world length, glyphWidth is world width; min/max maps magnitude to arrow length and stops colors. Direction follows the vector, zero vectors hidden. No physics added.

showGPUStreamlines

showGPUStreamlines(name, buffer, seeds, settings={}) — GPU RK2 integral curves in a regular xyz field. seeds=[{x,y,z},...] within grid bounds,1..256. steps1..256,stepLength>0 in world units,direction1 or-1,lineWidth,min/max,stops. <=65536 segments. Stops at bounds/zero/invalid values. Instantaneous normalized-field streamlines, NOT particle trajectories or elapsed time. Recomputed from current field each frame. Recreate view to change allocated steps. One view per program.

styleGPUField

styleGPUField(name, settings) — Patch existing field display: range, transfer stops, opacity density, quality samples, slice plane, arrow sizes/stride, streamline stepLength/direction/lineWidth or visible. Does not change field data or solver. getGPUFieldState returns the same stops/range for a UI legend.

clipGPUField

clipGPUField(name, point, normal, enabled=true) — Keep the field on the positive side of the world plane dot(normal,world-point)>=0. Works for volume, slice, arrows and streamlines. Nonzero normal required; set enabled=false to restore the whole view.

probeGPUField

probeGPUField(name, point) — Asynchronously sample the currently displayed field at world{x,y,z} using trilinear interpolation. Read reply.hit before values; values=[scalar,0,0] or[x,y,z], sum=scalar or vector magnitude. Outside or nonfinite contributing nodes return hit=false. Does not download the full field. At most4 pending probes.

getGPUFieldState

getGPUFieldState(name) — Return fieldView:{mode,buffer,units,lower,upper,spacing,nx,ny,nz,components,samples,glyphs,segments,seeds,fieldBytes,visualBytes,visible,settings}. settings contains range and stops for a shared legend. Counts are configured work, not measured GPU milliseconds.

hideGPUField

hideGPUField(name) — Hide the current field view without deleting data. styleGPUField(name,{visible:true}) restores it. removeGPUProgram removes field data and its visualization together. Ordinary clearRun also clears it.

GPU measurements and checkpoints

Measurement and checkpoint examples. Requires gpuMeasurements on the WebGPU player.

measureGPUStatistics

measureGPUStatistics(name,buffer,options={}): Promise<measurement>. GPU f32 aggregate with selected/invalid/excluded, sum/mean/minimum/maximum/rms, momentum/kineticEnergy/totalMass. options kind scalar|speed|kinetic|difference; offset/count (0=remaining); mass=1 or masses buffer; reference; region all|box|sphere, positions, lower/upper or center/radius; bins 0..128, low/high. Read GPU_MEASUREMENTS_CHECKPOINTS.txt.

histogramGPUBuffer

histogramGPUBuffer(name,buffer,low,high,bins=32,options={}): Promise<measurement>. 1..128 bins with inclusive high endpoint, separate underflow/overflow and invalid counts. kind speed needs xyz velocity; scalar default.

measureGPUKinetics

measureGPUKinetics(name,velocities,options={}): Promise<measurement>. f32 xyz velocities; {masses:"mass"} one mass per particle, or constant {mass:1}. Kinetic energy only; momentum xyz. Caller supplies solver-consistent masses and units.

measureGPURegion

measureGPURegion(name,values,positions,lower,upper,options={}): Promise<measurement>. Inclusive box, matching f32 xyz positions. Sample sum/mean, not automatically volume integration.

compareGPUBuffer

compareGPUBuffer(name,buffer,reference,options={}): Promise<measurement>. Same program and scalar length; stats of buffer-reference. rms=RMSE, mean=bias. Compare equal simulation times.

compareGPUMeasurements

compareGPUMeasurements(before,after): {energyChange,relativeEnergyChange,momentumChange}. Kinetic energy difference only. Relative null for zero baseline; external forces/damping may legitimately change energy.

startGPUMeasurementHistory

startGPUMeasurementHistory(name,buffer,options={}): history ID. intervalMs 250..60000 default500, capacity 1..2048 default120, measurement options. Max8 histories, one pending request each. Snapshot timeStart/timeEnd bracket GPU measurement.

getGPUMeasurementHistory

getGPUMeasurementHistory(id): {id,active,error,samples}. Bounded samples {timeStart,timeEnd,wallTime,result}. Prefer small capacities; not exact frame-synchronous timestamps.

stopGPUMeasurementHistory

stopGPUMeasurementHistory(id): stops and removes history; retrieve samples first. Program removal and clearRun also remove histories.

saveGPUCheckpoint

saveGPUCheckpoint(name,key,metadata={}): Promise<summary>. Pause typed WGSL program; snapshot raw buffers, passes and clock, explicit RNG/parameters. 32MiB raw, metadata16KiB text. Local browser IndexedDB64MiB serialized library; NOT server/owner asset storage. Reject physics-owned/editable-mesh/tracked-rope programs. Leaves paused.

loadGPUCheckpoint

loadGPUCheckpoint(newName,key): Promise<{name,key,bytes,clock,metadata,running:false}>. NEW unused name only. Checksum/schema validation, restore buffers/passes/clock, return paused. Reattach visuals with normal CS commands. Does not restore CS bodies, scenery or hidden JavaScript state.

listGPUCheckpoints

listGPUCheckpoints(): Promise<{checkpoints,usedBytes,limitBytes,location}>. Browser-origin local library summaries; same browser profile shares storage. No server sync.

deleteGPUCheckpoint

deleteGPUCheckpoint(key): Promise<{deleted}>. Delete named browser-local checkpoint; UI must confirm with user first.

GPU populations and neighbor queries

Population tools and examples. Requires gpuPopulations on the WebGPU player.

scanGPUBuffer

await scanGPUBuffer(name, source, destination, count=capacity) — exclusive sum of a u32 scalar buffer into a distinct equal-capacity u32 buffer. Returns total modulo 2^32 and overflow. Population tools require paused ordinary typed programs; count 1..262144.

assignGPUIds

await assignGPUIds(name, ids, firstId=1, count=capacity) — fill a u32 channel with consecutive nonzero IDs. Keep IDs with every channel reorder; choose a fresh range when recycling particles. Rejects u32 overflow.

compactGPUPopulation

await compactGPUPopulation(name, mask, channels, count=capacity) — retain mask!=0 in original order, reorder all listed correlated channels together, zero the discarded tail. Returns total retained. Include positions, velocities, IDs, active and any event history channels; omitted channels are NOT moved. No resize. Processed prefix only when count is supplied.

sortGPUPopulation

await sortGPUPopulation(name, keys, channels, count=capacity) — ascending stable u32 key sort, preserving original order for ties. Keys are automatically included; explicitly list every other correlated channel. IDs stay attached to data but array indices change. Bitonic GPU sort; no particle physics implied.

selectGPUPopulation

await selectGPUPopulation(name, source, destination, settings={}) — write u32 mask from f32 xyz positions with mode:'box', lower/upper or mode:'sphere', center/radius; scalar f32 with mode:'threshold', low/high. Optional active:u32 buffer and count. Bounds inclusive. Returns total selected; source/destination/active must be distinct.

collectGPUPopulation

await collectGPUPopulation(name, mask, ids, limit=64) — bounded GPU selection readback {total,returned,dropped,records:[{index,id}]}. Limit 1..256; order unspecified, not nearest-first. No full buffer readback.

getGPUPopulationEvents

await getGPUPopulationEvents(name, mask, ids, previousMask, previousIds, limit=64) — compare selection to two persistent u32 history channels, update history, return bounded enter/exit records with stable id and current slot index. ID replacement produces old-ID exit and new-ID enter. First call emits existing selections; overflow advances state and reports dropped. Poll explicitly after completed steps; not physical contact impulses.

buildGPUNeighborGrid

await buildGPUNeighborGrid(name, positions, ids, settings={}) — GPU linked-cell snapshot of f32 xyz positions, u32 IDs, optional active:u32. Set lower/upper, cellSize; upper exclusive. At most1048576 cells and262144 items. Returns valid total/outside/invalid/inactive. Rebuild after stepping/writing/reordering buffers; stale queries reject.

queryGPUNeighbors

await queryGPUNeighbors(name, center, radius, limit=64) — radius query against a fresh GPU grid; radius0..4cellSize, limit1..256. Returns total,returned,dropped,records with index,id,distance. Order unspecified; not nearest-first, no all-pairs solver. IDs must remain unique for identity-based tracking.

getGPUPopulationState

await getGPUPopulationState(name) — gridStale, gridBytes, cells, scratchBytes; population scratch and grid share the128MiB typed-program budget.

showGPUPopulation

await showGPUPopulation(name, positions, ids, settings={}) — render shared GPU buffers as camera-facing scientific point glyphs; ID0 hidden. Optional active and selection u32 channels; radius .06, extent100, color/highlight {x,y,z}, visible true, count. Selected points highlighted. Not GameObjects, rigidbodies, PBR meshes or a new physics solver. Uses MainCamera. Requires gpuPopulations capability, enginev21; refresh Game after deployment.

First- and third-person shooters

Shooter guide. Requires shooterToolsV1 on the WebGPU player.

loadPreparedAsset

await loadPreparedAsset(url,asset,name,x=0,y=0,z=0,settings={}) — Load a prepared prefab from a target-compatible HTTPS Unity bundle. Scenery/profile, not a legacy CSObject. Player settings invulnerable:false, impactImpulse:0..250 N·s. One player and one prepared environment. Await before using. shooterToolsV1 required; SHOOTER_TOOLS.txt.

getShooterState

await getShooterState(name) — Prepared root position/active/assemblies; player additionally health,ammo,reloading,running,firstPerson,muted,opponents{name,health,phase,position,shots},lastShot.

startShooter

startShooter(name) — Reset player and environment physical props; activate opponents. Click Game to capture mouse. WASD/Shift/Space move; mouse fire/right-aim; R reload; V view; Q shoulder. Does not create opponents or a grenade.

pauseShooter

pauseShooter(name) — Pause player input/opponent pursuit and fire; release mouse. Physics, smoke and debris continue.

resetShooterTargets

resetShooterTargets(name) — Restore opponents to their initial spawns and refill ammunition. No new opponents or environment reload.

shooterView

shooterView(name,view) — firstPerson or thirdPerson. Reuse MainCamera with authored arms or full-body presentation. No new camera.

shooterShoulder

shooterShoulder(name) — Switch third-person shoulder.

shooterSound

shooterSound(name,enabled=true) — Mute/unmute prepared gunshot and surface impact recordings. Every game UI includes sound control.

reloadShooter

reloadShooter(name) — Start weapon reload; inspect reloading/ammo via getShooterState.

fireShooter

await fireShooter(name) — Fire using final camera/muzzle, spread, obstruction and cooldown. Returns fired and shot. Actual body-part impulses and physical crate joints; no JavaScript hit-position polling loop.

swapShooterCharacter

swapShooterCharacter(name,model=0) — Select a prepared character/profile by zero-based index. Example Soldier0, Cowboy1. Does not retarget arbitrary GLBs or modify Dancer IK.

addShooterOpponent

await addShooterOpponent(name,player,x,y,z,model=0) — Place prepared humanoid opponent with pursuit, navigation, LOS, burst fire and limb ragdoll response. Matching environment navigation required. Maximum32.

dropSmokeGrenade

await dropSmokeGrenade(name,player,x,y,z,settings={}) — Physical drop,2.2s fuse, recorded burst, radial force and compute-volume smoke. settings force:1800(raw Unity force),radius:7.5m,fuse:2.2s,seconds:14 emission,color:"#d1d9db". Requires WebGPU. Maximum4; remove root before reusing name.

createSmoke

createSmoke(name,x,y,z,seconds=14,color="#87918a") — Lit GPU volumetric smoke at position, emission .1..120 seconds then24s dissipation. Requires WebGPU. Maximum4 standalone volumes.

restorePhysicalAssemblies

restorePhysicalAssemblies(name) — Restore all prepared jointed assemblies beneath root. Same boards/materials; rebuild constraints, zero velocities, resume physics. No intact/broken model substitution.

setImpactSurface

setImpactSurface(name,surface) — Tag active object Wood,Concrete,Metal,Glass,Body or None for recorded impact sounds. Empty profile slots remain silent; no synthesized notes.

removePreparedAsset

removePreparedAsset(name) — Remove named prepared asset, opponent or smoke grenade. Do not leave stale player-owned opponent records; clearShooter removes the whole activity.

clearShooter

clearShooter() — Remove prepared scenery/player/opponents/smoke and restore MainCamera. Also runs from clearRun. Downloaded bundles are reused until frame destruction.

GPU physics preview: AVBD and IPBF

Experimental WebGPU capabilities and repeatable tests. Read the scope and material limits.

await showGPUPhysicsLab();

getAVBDCapabilities

getAVBDCapabilities() — inspect native GPU AVBD support, limits and operations. WebGPU preview only.

createAVBDWorld

createAVBDWorld(name,settings={}) — named GPU AVBD world. dt1/240 recommended, iterations8, maxSteps8. Add boxes/joints before run. See GPU_PHYSICS_PREVIEW.txt.

addAVBDBox

addAVBDBox(world,name,x,y,z,settings={}) — full size xyz, mass0=fixed, velocity/rotation/friction/hex color/visible. objectName with mass0 follows a CS object one-way. Not an ordinary CS object.

addAVBDJoint

addAVBDJoint(world,name,bodyA,bodyB,settings={}) — ball/fixed/spring, local anchorA/B, stiffness, restLength, optional breakForce/yieldTorque. radius>0 renders GPU rope. No pulley friction model.

getAVBDState

getAVBDState(world) — async diagnostics: contacts, overflow, pairDepth/floorDepth, energy, maxSpeed, steps, droppedSteps, backend, error. ok is command status; inspect error too.

getAVBDBody

getAVBDBody(world,body) — GPU body position/rotation/velocity/angularVelocity readback.

cutAVBDJoint

cutAVBDJoint(world,joint) — disable named constraint; reset restores it.

pushAVBDBody

pushAVBDBody(world,body,impulse,optionalPoint) — impulse or off-center impulse at world point.

getIPBFCapabilities

getIPBFCapabilities() — inspect real IPBF compute/readback availability, separate from PBF.

createIPBFFluid

createIPBFFluid(name,settings={}) — GPU IPBF. Default small .3m tank, side6 lattice, finite compliance1, iterations8, maxSteps2. Optional points/velocity/center/gravity/dt, boundary samples+volume, boxes as center/half-size pairs. All-pairs preview max1000 particles. No honey viscosity.

getIPBFState

getIPBFState(name) — GPU diagnostics: backend, kinetic, momentum, angularMomentum, maxSpeed, maxDensity ratio, meanCompression, nonfinite, degeneracy, readbackMs, time/steps/droppedSteps.

checkIPBFDerivatives

checkIPBFDerivatives(name) — GPU finite-difference gradient check; derivativeError is scaled error, not a full accuracy certificate.

moveIPBFBoundary

moveIPBFBoundary(name,position,rotation={},velocity={}) — prescribed transform/velocity for the single sampled boundary assembly. One-way; no default PhysX reaction.

runGPUCouplingTest

runGPUCouplingTest(settings={}) — isolated local Unity PhysX/GPU assay, not game-loop coupling. mass .01..1kg, ticks1..100, iterations1..32, delay0..3 ticks, optional hinge. Returns per-tick energy/momentum/penetration/readback metrics. delay>0 known unstable diagnostic only.

getGPUCouplingTest

getGPUCouplingTest() — running and tick progress of local coupling assay.

cancelGPUCouplingTest

cancelGPUCouplingTest() — cancel test, allow pending readback and isolated scene teardown to finish.

clearGPUPhysics

clearGPUPhysics() — clear AVBD/IPBF worlds and cancel coupling assay. Also automatically cleared by clearRun.

showGPUPhysicsLab

showGPUPhysicsLab() — compact modern control-panel test UI for water, coarse sand, cohesive snow candidate, GPU rope, reset/step/measure/coupling. No RunPod required.

runGPUPhysicsChecks

runGPUPhysicsChecks() — repeatable browser checks for all four presets, reset and two coupling runs; returns JSON evidence with browser/backend.

runAVBD

runAVBD(name) — resume simulation. GPU AVBD preview.

pauseAVBD

pauseAVBD(name) — pause simulation. GPU AVBD preview.

resetAVBD

resetAVBD(name) — restore initial state and pause. GPU AVBD preview.

removeAVBD

removeAVBD(name) — dispose world and resources. GPU AVBD preview.

stepAVBD

stepAVBD(name,steps=1) — advance 1..8 steps while paused. GPU AVBD preview.

runIPBF

runIPBF(name) — resume simulation. GPU IPBF preview.

pauseIPBF

pauseIPBF(name) — pause simulation. GPU IPBF preview.

resetIPBF

resetIPBF(name) — restore initial state and pause. GPU IPBF preview.

removeIPBF

removeIPBF(name) — dispose world and resources. GPU IPBF preview.

stepIPBF

stepIPBF(name,steps=1) — advance 1..8 steps while paused. GPU IPBF preview.

IPBF appearance

createIPBFFluid settings include color, tankColor, absorption (RGB per metre), opacity, roughness and refraction. Use a lit, contrasting tank to inspect the water. These controls affect rendering, not fluid viscosity.

createIPBFFluid("water", {color:"#058094", tankColor:"#d4dce0", opacity:1, absorption:{x:24,y:7,z:4}, roughness:0.16, refraction:0.45});

GPU foliage wind and continuous emitters

Wind and emitter guide

setGPUWind

setGPUWind(name, settings) — patch styled GPU foliage wind: windEnabled, windDirection, windStrength metres, windGust, windFrequency radians/s, windFlutter, windBase/local windHeight, windPaused, windTime. See GPU_WIND_EMITTERS.txt. Visual deformation, not collider physics.

createGPUEmitter

createGPUEmitter(name, settings) — attach a paused continuous visual GPU emitter to an existing styled collection. rate*lifeMax <= capacity. position/box/direction/speed/spread, gravity/wind/drag, seed, size/color over lifetime, spin and optional ONE-WAY floor. Owns particle/style buffers; no Unity collision coupling.

setGPUEmitter

setGPUEmitter(name, settings) — patch emitter settings only while paused; successful patch resets and stays paused. Capacity >= rate*lifeMax.

startGPUEmitter

startGPUEmitter(name) — resume continuous emission and motion; fixed1/60s, up to4 steps/frame.

pauseGPUEmitter

pauseGPUEmitter(name) — freeze emission and particle motion.

resetGPUEmitter

resetGPUEmitter(name) — clear particles and reset deterministic seed/clock; returns paused.

stepGPUEmitter

stepGPUEmitter(name) — advance one1/60s step while paused.

removeGPUEmitter

removeGPUEmitter(name) — release simulation ownership, retain rendered collection for custom WGSL.

getGPUEmitterState

getGPUEmitterState(name) — reply.emitter gives settings/capacity/steps/simulatedTime/droppedSteps/running/dt/collisionMode. No full particle download.

createGPUInstances

createGPUInstances(name, shape, count, options={}): Promise. shape billboard/sphere/box/custom/card/blade/leaf. card/blade/leaf are subdivided root-Y0..1 meshes (v22). Version 2 count 1..1048576 per collection, total <=4000001, <=8 collections; version 1 <=262144 per collection. Split large runs into chunks using WGSL global-index offsets. options size=.1, extent=1000 (render bounds half-size about origin), meshObject for existing static custom mesh. Starts paused, instances at origin, white, mass 1. No Rigidbody or CS object registry.

styleGPUInstances

await styleGPUInstances(name, settings={}) — enable/patch optional lit instance renderer for billboard/sphere/box/custom. Settings: tint/emission Vector3, lit, metallic, roughness, normalStrength, tiling/offset Vector2, surface opaque/cutout/transparent/additive, opacity/cutoff, castShadows/receiveShadows, enabled, frustumCulling, maxDistance, lodDistance/farDistance, lodMesh/farMesh, shadowDistance. Old64-byte particle layout retained. Call before compileGPU to expose optional styles binding4; see GPU_RENDERING.txt. Requires instanceMaterials. Engine22: windEnabled/windStrength/windDirection/windGust/windFrequency/windFlutter/windBase/windHeight/windPaused/windTime, worldCards, streakSeconds/streakLimit. See GPU_WIND_EMITTERS.txt.

GPU trails, animated sources and scene contacts

Trails and effects guide

createGPUTrails

createGPUTrails(name, settings={}) — GPU history ribbons on an existing collection. count/first/stride/points/lifetime/width/endWidth/color/endColor/additive/teleport. Birth changes and teleports break trails. See GPU_TRAILS_EFFECTS.txt.

createObjectTrail

createObjectTrail(name, objectName, settings={}) — dedicated hidden collection following an ordinary CS object; offset, width, lifetime. No physics changes. Remove with removeGPUInstances(name).

resetGPUTrails

resetGPUTrails(name) — clear ribbon history without resetting the source.

removeGPUTrails

removeGPUTrails(name) — remove ribbon history/rendering; preserve source collection.

getGPUTrailState

getGPUTrailState(name) — trails count, points, samples, bytes and clock.

moveGPUEmitter

moveGPUEmitter(name,x,y,z) — live source position/offset; no particle reset. Local when attached.

setGPUEmitterCollisions

setGPUEmitterCollisions(name,settings={}) — paused emitter: enable one-way GPU scene contacts. radius/bounce/friction; optional twoWay/events/mass/maxImpulse/maxTorque.8192 slots max. Disable enabled:false before reconfiguration.

addGPUEmitterCollider

addGPUEmitterCollider(name,objectName,kind="body") — existing CS sphere/box/capsule collider; kind="scenery" for static MeshCollider/TerrainCollider BVH. Two-way total slot mass <=1/4 of body mass.

removeGPUEmitterCollider

removeGPUEmitterCollider(name,objectName) — unregister collider and invalidate pending feedback.

refreshGPUEmitterCollider

refreshGPUEmitterCollider(name,objectName) — recapture registered static mesh/terrain after edits.

getGPUEmitterContacts

getGPUEmitterContacts(name,count=32) — drain bounded aggregated collider-impact reports; requires events or twoWay enabled. Count1..256. Not per-particle readback.

setGPUInstanceTexture

setGPUInstanceTexture(name,slot,url) — PNG texture for styled instances; slot albedo, normal, or metalRough. HTTPS or same-origin URL, up to4MiB and2048 square. Albedo supports atlas animation.

styleGPUInstances

await styleGPUInstances(name, settings={}) — enable/patch optional lit instance renderer for billboard/sphere/box/custom. Settings: tint/emission Vector3, lit, metallic, roughness, normalStrength, tiling/offset Vector2, surface opaque/cutout/transparent/additive, opacity/cutoff, castShadows/receiveShadows, enabled, frustumCulling, maxDistance, lodDistance/farDistance, lodMesh/farMesh, shadowDistance. Old64-byte particle layout retained. Call before compileGPU to expose optional styles binding4; see GPU_RENDERING.txt. Requires instanceMaterials. Engine22: windEnabled/windStrength/windDirection/windGust/windFrequency/windFlutter/windBase/windHeight/windPaused/windTime, worldCards, streakSeconds/streakLimit. See GPU_WIND_EMITTERS.txt. Engine23: atlasColumns/atlasRows/atlasFrames/atlasFPS/atlasLoop/atlasBlend, softEdge/softDepth; see GPU_TRAILS_EFFECTS.txt.

createGPUEmitter

createGPUEmitter(name, settings) — attach a paused continuous visual GPU emitter to an existing styled collection. rate*lifeMax <= capacity. position/box/direction/speed/spread, gravity/wind/drag, seed, size/color over lifetime, spin and optional ONE-WAY floor. Owns particle/style buffers; no Unity collision coupling. Engine23: emissionShape box/path/mesh; path points, meshObject, followObject, surfaceNormals. See GPU_TRAILS_EFFECTS.txt.

setGPUEmitter

setGPUEmitter(name, settings) — patch emitter settings only while paused; successful patch resets and stays paused. Capacity >= rate*lifeMax. Engine23: emissionShape box/path/mesh; path points, meshObject, followObject, surfaceNormals. See GPU_TRAILS_EFFECTS.txt.

getGPUEmitterState

getGPUEmitterState(name) — reply.emitter gives settings/capacity/steps/simulatedTime/droppedSteps/running/dt/collisionMode. No full particle download. Also returns emitterPhysics diagnostics for enabled contacts.

GPU swarms, shared animation and CS handoff

Swarms and animation guide

createGPUSwarm

createGPUSwarm(name, settings={}) — GPU flock steering on an existing styled collection; paused initially. Settings: center, halfSize, target, size, radius, neighborRadius, separationRadius, separation, alignment, cohesion, seeking, speed, acceleration, avoidance, lookAhead, modelRotation, seed, maxNeighbors. 1..65536 members; steering not solid contact physics. See GPU_SWARMS_ANIMATION.txt.

setGPUSwarm

setGPUSwarm(name, settings) — Update steering settings while paused; retains positions. resetGPUSwarm applies new seeded positions/size.

setGPUSwarmTarget

setGPUSwarmTarget(name, x, y, z) — Change steering goal, including while running; Unity/GPU coordinates.

addGPUSwarmObstacle

addGPUSwarmObstacle(name, objectName) — Avoid named Unity box, sphere or capsule collider shapes; max32. One-way steering only; no mesh/CCD or forces.

removeGPUSwarmObstacle

removeGPUSwarmObstacle(name, objectName) — Remove named obstacle and its child colliders from swarm avoidance.

startGPUSwarm

startGPUSwarm(name) — Start/resume GPU steering, bounded 60Hz catch-up.

pauseGPUSwarm

pauseGPUSwarm(name) — Pause steering; independent animation can keep playing.

resetGPUSwarm

resetGPUSwarm(name) — Pause and restore seeded positions; handed-off members remain inactive.

stepGPUSwarm

stepGPUSwarm(name) — One fixed steering step while paused.

removeGPUSwarm

removeGPUSwarm(name) — Remove steering and release buffer ownership; leave instance positions.

getGPUSwarmState

getGPUSwarmState(name) — Settings, steps, dropped steps, GPU grid overflow, neighbor limits, invalid states, projections and memory; diagnostics readback is asynchronous.

createGPUAnimatedInstances

createGPUAnimatedInstances(name, count, sourceObject, settings={}) — Shared GPU bone animation. Use an existing generic/legacy skinned object, or sourceObject="" and settings.animationAsset="trout". Settings: size, extent, sampleRate, material, animation. 1..65536; setup samples once. See rig limitations in GPU_SWARMS_ANIMATION.txt.

setGPUAnimation

setGPUAnimation(name, settings) — Collection playback clock (paused,time) and nearFPS/mediumFPS/farFPS (1..120). Rates<=15 use nearest sampled poses. Rendering/skinning still runs for drawn vertices.

setGPUInstanceAnimations

setGPUInstanceAnimations(name, entries, offset=0) — Up to4096 member playback states: clip, offset seconds, speed0..10, loop, blendClip, blendOffset, blend0..1. Clip names/indices via getGPUAnimationState. loop:false holds final pose.

getGPUAnimationState

getGPUAnimationState(name) — Shared clip names, bone/frame count, clock, rates and GPU memory.

makeGPUInstanceObject

makeGPUInstanceObject(name, index, objectName, settings={}) — Pause swarm first. Turn one member into a real CS rigid prop (mass,gravity settings), preserving pose/transform/velocity. Stops custom GPU program. Registers box collider/Rigidbody/CS physics then hides GPU member. Pose becomes static; no character controller/ongoing skeletal animation. Failure preserves original.

setGPUInstanceTransforms

setGPUInstanceTransforms(name, entries, offset=0) — Up to4096 instance transforms: rotation in degrees, scale vector and emission multiplier. Applies to styled static or animated instances; swarm steering owns rotation while running.

GPU water surfaces and CS buoyancy

GPU water surface guide

createGPUWater

await createGPUWater(name, width=16, length=12, settings={}) — GPU rectangular water heightfield. center, resolution16..256, waveSpeed, damping, boundary reflect/absorb, amplitude/wavelength/angle, picking, appearance. Four surfaces maximum. See GPU_WATER_SURFACES.txt; requires engine25.

setGPUWater

setGPUWater(name, settings) — patch waveSpeed/damping/boundary, traveling amplitude/wavelength/angle, shallowColor/deepColor HTML hex, opacity/depthScale/smoothness/foam/foamThreshold/reflections/picking. Recreate to change dimensions/resolution/center.

disturbGPUWater

disturbGPUWater(name, x, z, strength=1, radius=1) — inject bounded velocity ripple at Unity-worldXZ. strength-5..5, radius>=one grid cell. GPU water only.

sampleGPUWater

await sampleGPUWater(name, points) — 1..128 world Vector3 samples; .waterSamples returns height/verticalVelocity/foam/inside. Sparse asynchronous readback.

getGPUWaterState

await getGPUWaterState(name) — .water contains steps/substeps/time, resolution/bytes, bodies/readbacks/sampleAge/staleFrames, forceClamps/maxForce, disturbances, sampled maxDisplacement/maxVelocity/invalid. Reduction asynchronous; repeat after a frame.

startGPUWater

startGPUWater(name) — resume GPU waves.

pauseGPUWater

pauseGPUWater(name) — pause wave evolution; ordinary Rigidbody buoyancy remains active.

resetGPUWater

resetGPUWater(name) — zero waves/time/diagnostics; does not move existing CS actors.

stepGPUWater

stepGPUWater(name, seconds=.02) — advance paused waves, .0001..05 seconds with bounded CFL substeps.

removeGPUWater

removeGPUWater(name) — dispose water/render/query resources; existing CS bodies remain.

addGPUWaterBody

await addGPUWaterBody(name, objectName, settings={}) — attach existing root Rigidbody with box/sphere collider to four-point buoyancy/drag/wakes. settings density(water kg/m3)=1000, volume=auto, drag=2, wake=.3,maxAcceleration=30. Max16; no transform positioning or interpolation changes. Approximate delayed coupling, not conserved volume-fluid reaction.

removeGPUWaterBody

removeGPUWaterBody(name, objectName) — stop flotation/wake coupling without deleting the object.

GPU elastic beams and rebound

Guide and examples. Requires the v27 WebGPU player.

createGPUBeam

await createGPUBeam(name, settings={}) — GPU elastic straight beam/rod. Defaults: 25 nodes, first 3 clamped, endpoints (-2,1.2,0)..(2,1.2,0), EA100000 N, EI2000 N m², damping3/s. See GPU_BEAMS.txt. Wait for state.beam.ready before applying external contacts.

setGPUBeam

setGPUBeam(name, settings) — change stiffness, damping, gravity, appearance, iterations or substeps. Recreate for new endpoints, nodes, nodeMass or initial clamp.

setGPUBeamForce

setGPUBeamForce(name, node, x, y, z) — sustained nodal force in newtons. Zero removes it; no per-frame command needed.

setGPUBeamPin

setGPUBeamPin(name, node, x, y, z, pinned=true) — move a kinematic pin; false releases an added pin. Initial clamp cannot be released individually. No reaction to an attached body.

addGPUBeamBody

addGPUBeamBody(name, objectName) — two-way normal contact with an existing enabled SphereCollider/Rigidbody. Leaves body properties unchanged. Capsule centerline contact, not the full visible plank width. No friction or mesh colliders yet.

removeGPUBeamBody

removeGPUBeamBody(name, objectName) — detach a registered sphere contact without deleting the body.

startGPUBeam

startGPUBeam(name) — resume GPU beam stepping.

pauseGPUBeam

pauseGPUBeam(name) — pause beam stepping; registered Unity bodies remain independent.

resetGPUBeam

await resetGPUBeam(name) — restore beam rest pose, pins and zero forces; retain body registrations. Does not reset the Unity bodies.

removeGPUBeam

removeGPUBeam(name) — dispose beam GPU buffers, renderer and contact registrations. clearRun also disposes beams.

getGPUBeamState

await getGPUBeamState(name) — result.beam contains ready, running, finite, error, tip, tipDeflection, maxStretch, overlap/maxOverlap (m), impulse (N s), sampleAge/maxSampleAge (s), steps, staleSteps and generation.

GPU sculpting and plastic deformation

Guide and examples. Requires the v27 WebGPU player.

sculptGPUMesh

await sculptGPUMesh(meshName, center, amount, settings={}) — add a cumulative smooth local brush stroke to an editable GPU mesh. center is a Unity-world Vector3; positive amount raises along settings.direction (default up), negative amount lowers; settings.radius defaults1. Existing mask weights limit the stroke. Refreshes normals. Geometry only: does not edit the source object or create/update a PhysX collider. Requires gpuMeshSculpting.

showGPUPhysicsStrain

await showGPUPhysicsStrain(meshName, maximum=.2) — color a GPU linear-elastic mesh by per-vertex maximum neighbor-edge strain. Enables strain sampling for visualization. maximum is the color scale, .0001.. .9. Requires enabled mesh physics. See GPU_DEFORMATION.txt.

GPU cloth wind and pins

Guide and examples. Requires the v27 WebGPU player.

setGPUMeshWind

setGPUMeshWind(name,x,y,z) — wind velocity in m/s for a GPU XPBD surface. Enables air drag. See GPU_CLOTH.txt for current contact limitations.

setGPUMeshPin

setGPUMeshPin(name,vertex,x,y,z) — pin an XPBD mesh vertex to a kinematic world target. No dynamic attachment reaction.

releaseGPUMeshPin

releaseGPUMeshPin(name,vertex) — release an XPBD mesh vertex; reset restores the original pins.

Named game sounds

# Named game sounds from My library

CS now supports named browser-side sound commands in script.js. They are official CS APIs, not a forbidden browser workaround. No Unity build or numbered slot is needed. The old statement that CS has no sound playback command is obsolete. This is audio playback, not Unity 3D spatial audio.

- `await loadSound(name, url)`: preload a playable MP3, WAV or Ogg file by a nonempty name up to 100 characters. URL must be an HTTP(S) file URL, normally the owner's saved HTTPS library URL. Returns `{name,url,ready,duration,playing,muted,volume,loop}`. Duration is seconds, or null when unknown. Same name+URL reuses its load; changing a name's URL unloads its former sound. Failure, cancellation or a 30-second timeout rejects. No automatic playback.
- `playSound(name, volume = 1, loop = false)`: returns a Promise with the same state after playback starts. Volume is 0..1; loop must be boolean. False plays once, true repeats. Replaying a name restarts it from the beginning; distinct names may play together. This does not create overlapping copies of one sound. Preload before gameplay. Browser autoplay rules apply: use a real user Play/key/click interaction; report a rejection rather than claim it played.
- `stopSound(name)`: stops and rewinds; returns false if missing, true otherwise. Keeps preloaded audio.
- `setSoundVolume(name, volume)`: adjust 0..1 volume without restarting; returns current state.
- `getSound(name)`: inspect state; missing names throw. Readback cannot prove someone heard a sound.
- `unloadSound(name)`: stop and release one sound; true if present, false if missing.
- `clearSounds()`: stop and release all named sounds. Also called by clearCode/clearRun and when the Game iframe unloads, including cancellation of pending loads.

Keep durable sound dependencies in ordinary game setup code so sharing/reloading works without a team or RunPod. Do not use ephemeral blob URLs, local RunPod paths or library owner credentials in game code. Uploading to My library does not itself change the game.

```javascript
async function prepareSounds() {
    await loadSound("jump", "/cs_worldbuilder_edition/audio/user-files/OWNER_HASH/CONTENT_HASH.wav");
}

function playJumpSound() {
    playSound("jump").catch(function (error) {
        console.warn(error.message);
    });
}
```

The URL above is a placeholder. Retrieve the actual `kind:"sound"` item from the authenticated owner catalogue `asset_library.php?role=agent&sid=$RDS_SESSION_ID`, using the existing Bearer RDS_TOKEN. Read names, URLs, duration and license; reuse the owner's recorded boing instead of downloading another. Stefan adds `playJumpSound()` inside the existing successful jump action. Do not alter physics, key handling, actors or jump impulses for an audio task. Preload during the game's existing asynchronous setup before enabling gameplay. Do not define a replacement CS `load` or `playSound` function.

Library/Audio → AudioLab records microphone sounds and uploads them only when Save is clicked. Auto-trim is enabled by default, removes leading/trailing quiet time, preserves interior pauses, and can be undone before saving. The account allowance is 1,000 MB shared with models/textures. Saving shows success or the actual error beside Save. Legacy numbered playback remains for older activities; do not use it for new games.

Sound on/off for every game

Every game interface uses the standard Sound on/off control supplied by the shared Game player, including keyboard-only games and older interfaces. Do not omit, cover, remove or replace it, and do not add a competing mute state. It starts on for a new visitor and remembers that visitor’s choice across runs/reloads; a saved/shared game must never force sound back on. This mutes named CS game sounds without overwriting per-sound volume or stopping loops. AudioLab preview/recording controls are independent. Preload every game sound with loadSound in the saved editor script and await it during setup. Never rely on AudioLab or a relay-only preload to initialize the game. Before sharing, verify from a fresh game with no AudioLab, no worker and no owner login. The normal challenge login/coin rules still apply to playing the challenge.