Using Gizmos


Gizmos are objects with special and complex behaviors. To see and adjust the behaviors for each gizmo, open its Properties Panel.

  • The only gizmos that players will be able to see are portals and text. Players will see a portal as a door, and text as the actual text being displayed.

  • In Build Mode, collaborators can see gizmos, their Properties Panels and any changes that are made.

  • The only gizmos that can't be scaled are portals and spawn points.

Trigger


The Trigger gizmo is used to trigger an event when you enter or exit a specified area.

To use the Trigger gizmo:

  1. From Build Mode, select the Three Line icon > Build icon > Gizmos.

  2. Grab the Trigger gizmo. You can now edit the properties by grabbing the gizmo and selecting the Three Dot icon with your controller.

Things to remember:

  • Each trigger can be activated by either players or objects, but not both. If Triggered By is set to Players, any player in the world will be able to activate the Trigger.

  • If Triggered By is set to Objects Named..., the Triggered by Objects Named field must also be filled out. This field can currently only take one name, and any object with that name will be able to activate the trigger.

  • Note that objects may only have one name (or one word as a name), but multiple objects can have the same name. The size of the trigger area can be adjusted by using the handles, just like the rest of the shapes.

Was this answer helpful?

Environment

Find out how to customize the environment and atmosphere of the world you're building.

The Environment gizmo lets you access settings for lighting and environment. Keep in mind, you can only have one Environment gizmo per world.

To use the Environment gizmo:

  1. From Build Mode, select the Three Line icon > Build icon> Gizmos.

  2. Grab the Environment gizmo. You can now edit the properties by grabbing the gizmo and selecting the Three Dot icon with your controller.

  3. Select an option from the Lighting dropdown to add ambient lighting (or a sky) with a preset color and intensity.

Adjusting Fog Density lets you change how light spreads through the world. The higher the number, the denser the fog, and the harder it will be to see objects at a distance. The fog will take on the color of the ambient lighting (sky).

You can also show or hide the floor grid. The grid is 64 square meters in size, with each tile representing one square meter. The grid can't be edited, moved or selected, and doesn't have a Properties Panel, but it's a solid surface that players and simulated objects can move around on. The grid is only visible from above.

Was this answer helpful?

Script

Learn how to add interactivity, motion and more to your world. .


To add a script to a world:

  1. From Build Mode, select Gizmos.

  2. Grab a Script and drag it out into the world.


To write a script:

  1. Highlight the script and select the Three Dot icon Properties to open the Script Panel.

  2. At the top, name the script.

  3. In the left column, tap on a field to add the name of any object you’ll be referencing.

  4. In the right column, add variables.

  5. Tap New Code Block and select options from the dropdown.

  6. Tap Compile when you’re done to save the script.


To attach a script to an object:

  1. Open the object’s Properties Panel.

  2. At the bottom of the panel, select the script from the dropdown for Attached Script.


To connect an object reference:

  1. Open the Properties Panel of the object you want to reference.

  2. Grab the Entity Reference connector on the right side of the panel.

  3. Attach the connector to the input on the bottom left side of the Properties Panel for the object with the attached script.


Additional things to know about scripting:

  • Make sure to tap Compile after writing a script. Otherwise the script won’t be saved.

  • Scripts need to be attached to an object in order to run.

  • There can only be one script per object.

  • The name of the script will be displayed on the gizmo itself. If you change the name of a script, it won’t automatically update references to that script.

  • Collaborators can see the Script Panel, but they won’t be able to see changes unless the script is compiled and the panel is closed and reopened.

Code Block Reference

To learn more, see our article on using code blocks.

Was this answer helpful?
Item in LibraryItem in FolderParametersDescriptionTips
Events
When world is startedWhen world is startedEvent runs when world starts. This will happen when the first person enters the world's instance.
When event is receivedWhen event[myevent] with [obj] is receivedEvent runs when a custom event is received by this object. The custom event can be sent by the same script or a script on another object.
When trigger is entered by objectWhen event [triggerenter] with [obj] is receivedObject: The object that entered triggerEvent runs when an object enters the trigger gizmo.Note: The trigger must be configured to detect objects with a specific tag, and the object must have that tag.
When trigger is exited by objectWhen event [triggerexit] with [obj] is receivedObject: The object that exited triggerEvent runs when an object exits the trigger gizmo.Note: The trigger must be configured to detect objects with a specific tag, and the object must have that tag.
When trigger is entered by playerWhen event [triggerenter] with [player] is receivedPlayer: The player that entered the triggerEvent runs when a player enters the trigger gizmo.Note: The trigger must be configured to detect players.
When trigger is exited by playerWhen event [triggerexit] with [player] is receivedPlayer: The player that exited the triggerEvent runs when a player exits the trigger gizmo.Note: The trigger must be configured to detect players.
When colliding with objectWhen event [collisionenter] with [object] is receivedObject: The object that collided with the object that this script is attached to.Event runs when object collides with another object.Note: The object must be configured to detect collisions.
When colliding with playerWhen event [collisionenter] with [player] is receivedPlayer: The player that collided with the object this script it attached to.Event runs when object collides with the players head or torso.Note: The object must be configured to detect collisions.
When object is grabbed by playerWhen event [grabstart] with [player] is receivedPlayer: The player that grabbed the object that this script it attached toEvent runs when this object is grabbed by a player.
When object is released by playerWhen event [grabend] with [player] is receivedPlayer: The player that released the object that this script it attached toEvent runs when this object is released by a player.
When object is attached to playerWhen event [attachstart] with [player] is receivedPlayer: The player that attached the object that this script it attached toEvent runs when this object is attached to a player.Note: The object being manipulated must be marked as "Interactive" with "Grabbable" in order to be set as attachable.
When object is unattached from playerWhen event [attachend] with [player] is receivedPlayer: The player that unattached the object that this script it attached toEvent runs when this object is detached from a player.Note: The object being manipulated must be marked as "Interactive" with "Grabbable" in order to be set as attachable.
When index trigger is pressedWhen event [indextriggerdown] with [player] is received while self is grabbedPlayer: The player that pressed their trigger while holding the object that this script it attached toEvent runs when the index trigger on the oculus controller is pressed. This event will only work on an object that is being grabbed by a player.
When index trigger is releasedWhen event [indextriggerup] with [player] is received while self is grabbedPlayer: The player that released their trigger while holding the object that this script it attached toEvent runs when the index trigger on the oculus controller is released. This event will only work on an object that is being grabbed by a player.
When button1 is pressedWhen event [button1down] with [player] is received while self is grabbedPlayer: The player that pressed button 1 while holding the object that this script it attached toEvent runs when button 1 on the oculus controller is pressed. This event will only run on an object that is being grabbed by the hand that is holding the controller.Note: This event will only run on an object that is being grabbed by the hand that is holding the controller.
When button1 is releasedWhen event [button1up] with [player] is received while self is grabbedPlayer: The player that released button 1 while holding the object that this script it attached toEvent runs when button 1 on the oculus controller is released. This event will only run on an object that is being grabbed by the hand that is holding the controller.Note: This event will only run on an object that is being grabbed by the hand that is holding the controller.
When button2 is pressedWhen event [button2down] with [player] is received while self is grabbedPlayer: The player that released button 2 while holding the object that this script it attached toEvent runs when button 2 on the oculus controller is pressed. This event will only run on an object that is being grabbed by the hand that is holding the controller.Note: This event will only run on an object that is being grabbed by the hand that is holding the controller.
When button2 is releasedWhen event [button2up] with [player] is received while self is grabbedPlayer: The player that released button 2 while holding the object that this script it attached toEvent runs when button 2 on the oculus controller is released. This event will only run on an object that is being grabbed by the hand that is holding the controller.Note: This event will only run on an object that is being grabbed by the hand that is holding the controller.
Send event to objectSend event [myevent] to [self] with [param]Object: The object that the event is sent to param: The parameters the event will receiveSends a custom event to an object variable. The event will be received by the object that is being referenced by the object variable.
Send event with delaySend event [myevent] to [self] after [number] secondsObject: The object the event is sent to number: The number of seconds to delaySends a custom event to an object variable, with a set delay. The event will be received by the object that is being referenced by the object variable.
Cancel sending event with delayCancel sending event [myevent] to [self]Object: The object to stop sending a custom event toCancels a custom event from being sent.
Connections
Connect to eventconnect [self] [triggerenter] to local event [enter]object: The object the where the non-local script event fires event: The event in the non-local script event: The event in the local script that the non-local script should connect to Connects an event in another object to an event in the local script, so when the event in the other object is triggered, the event in the local script is triggered too.Note: This is useful for connecting multiple triggers in a script to one or multiple events in order to make a triggerable system.
Motion Tab
Instant Motion
Move toaction [moveto with [vector 1 / 0 / 0]] on [self]vector: The position in world space that the object moves to object: The object that the motion applies toInstantly moves the object to the coordinates provided.Note: The object being manipulated must be marked as "Interactive" or "Animated" in the properties panel of the object.
Move byaction [move with [vector1 / 0 / 0]] on [self]vector: The direction and distance the object will move by object: The object that the motion applies toInstantly moves the object relative to its current position by adding the vector to the current position.
Rotate toaction [rotateto with [rotation 90 / 0 / 0]] on [self]rotation: The angle the object will rotate to object: The object that the motion applies toInstantly rotates the object to the rotation provided.
Rotate byaction [rotate with [rotation 90/ 0 / 0]] on [self]rotation: The angle the object will rotate by object: The object that the motion applies toInstantly rotates the object by adding the supplied rotation to the current rotation.
Scale toaction [scale with [vector 1 / 0 / 0]] on self]]vector: The size the object will scale to object: The object that the motion applies toInstantly sets the scale to the value provided.
Motion Over Time
Move to over timeaction [moveto with [vector 1 / 0 / 0] over [number {1} sec]] on [self]vector: The positon in world space that the object moves to number: The number of seconds it takes to move object: The object that the motion applies to Moves the object along a line from its current position to a new coordinate over the given time.
Move by over timeaction [move with [vector 1 / 0 / 0] over [number {1} sec]] on [self]vector: The direction and distance the object will move by number: The number of seconds it takes to move object: The object that the motion applies toMoves the object along a line from its current position to a new coordinate that is the sum of the current position and the given coordinate, over the given time.
Rotate to over timeaction [rotateto with [rotation 90 / 0 / 0] over [number {1} sec]] on [self]rotation: The angle the object will rotate to number: the number of seconds it takes to rotate object: The object that the motion applies toRotates the object from its current rotation to the given rotation over the given time.
Rotate by over timeaction [rotate with [rotation 90 / 0 / 0] over [number {1} sec]] on [self]rotation: The angle the object will rotate by number: the number of seconds it takes to rotate object: The object that the motion applies toRotates the object from its current rotation by the given rotation over the given time.
Scale to over timeaction [scale with [vector 1/ 1/ 1] over [number {1} sec]] on [self]vector: The size the object will scale to number: the number of seconds it takes to scale object: The object that the motion applies toScales the object from its current scale to the given scale over the given time.
Player Motion
Respawn playeraction [respawn with [param]] on [self]playerid: The player that will be respawned object: The spawn point to respawn them toTeleports a player to a spawn point.
Physical Motion
Disable object physical motiondisable [self] physical motionobject: The object that physical motion is being disabled onLocks a physics object in place. Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Enable object physical motionenable [self] physical motionobject: The object that physical motion is being enabled onUnlocks a physics object, allowing it to be moved.Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Pushaction [+Velocity with [vector 1/ 1/ 1]] on [self]vector: The velocity being added object: The object that physical motion is being applied toThe object's velocity becomes equal to its current velocity, plus the given velocity.Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Push with massaction [+impulse with [vector 1/ 0/ 0]] on [self]vector: The velocity being added object: The object that physical motion is being applied toThe object's velocity becomes equal to its current velocity, plus the given velocity divided by the object's mass (heavier objects have their velocity adjusted less).Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Push in local spaceaction [+VelLocal with [vector 1/ 0/ 0]] on [self]vector: The velocity being added object: The object that physical motion is being applied toThe given velocity is rotated to the object's rotation, then a Push runs (x becomes left/right, y becomes above/below, z becomes forward/backward).Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Push in local space with massaction [+ImpLocal with [vector 1/ 0 / 0]] on [self]vector: The velocity being added object: The object that physical motion is being applied toThe given velocity is rotated to the object's rotation, then a Push with Mass runs (x becomes left/right, y becomes above/below, z becomes forward/backward).Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Spin action [+AngVel with [vector 1/ 0/ 0]] on [self]vector: The angular velocity being added object: The object that physical motion is being applied toThe object's angular velocity becomes equal to its current angular velocity, plus the given angular velocity.Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Spin in local spaceaction [+AngVelLocal with [vector 1/ 0/ 0]] on [self]vector: The angular velocity being added object: The object that physical motion is being applied toThe given velocity is rotated to the object's current rotation, then a Spin runs (x becomes pitch, y becomes yaw, z becomes roll).Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Stop physical motionstop physical motion [self]object: The object that the physical motion is being stopped onThe object's velocity and angular velocity both become zero.Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Launch from objectaction [LaunchFrom with [self] [number {10}]] on [self]object: The object whose position and direction will be used to launch from number: The speed to launch it at object: The object that will be launchedMakes the object become owned by the same owner of the "launch from" object (i.e. object specified by the first parameter), sets the position and rotation of the object to match that of the "launch from" object, and then sets the object's velocity to match its forward direction with a magnitude (speed) equal to the value of the second parameter.Note: The object being manipulated must be marked as "Interactive" with "Physics" in the properties panel of the object.
Actions Tab
Object
Show objectshow [self]object: The object that will turn visibleMakes object visible in your world.Note: This will currently also affect collisions on an object. The object will be made collidable.
Hide objecthide [self]object: The object that will turn hiddenHides the object in your world.Note: This will currently also affect collisions on an object. The object will have collisions turned off.
Paint objectaction color with [color 1/ 0/ 0] on [self]color: The rgb color to paint the object with object: The object that will be paintedSets the color of the object.
Enable objectenable [self]object: The trigger that will be enabledEnables a trigger's ability to detect people or objects. This can only be used on triggers.
Disable objectdisable [self]object: The trigger that will be disabledDisables a trigger's ability to detect people or objects. This can only be used on triggers.
Set simulatedaction [setsimulated with boolean {true/false}] on [self]boolean: The true or false value that the simulated property will be set to object: The object that will have its simulation setEnables or disables the "simulated" property. If off, the object cannot move.
Set gravityaction [setgravity with boolean {true/false}] on [self]boolean: The true or false value that the gravity property will be set to object: The object that will have its simulation setEnables or disables gravity simulation on this object.If on, the object will fall to the floor. If off, it wil act like it's floating in space.
TextDisplay textaction [display with [number {1}] on [self]string/number: The value the text gizmo will display object: The text gizmo that displays the string/numberSets the displayed text in the text gizmo.
Animation
Play animationplay animation on [self]object: The object that will play its animationPlays the object's animation.
Pause animationpause animation on [self]object: The object that will pause its animationPauses the object's animation.
Stop animationstop animation on [self]object: The object to stop its animation
Sound
Play soundplay sound on [self]object: The sound gizmo that will playPlays a sound gizmo.Note: A sound must be stopped before it can be played again.
Pause soundpause sound on [self]object: The sound gizmo that will pausePauses a sound gizmo.Note: A sound must be stopped before it can be played again.
Stop soundstop sound on [self]object: The sound gizmo that will stopStops a sound gizmo.Note: A sound must be stopped before it can be played again.
Particles and Trails
Play visual fxplay visual effects on [self]object: The visual effect gizmo that will playPlays a visual effects gizmo.
Stop visual fxstop visual effects on [self]object: The visual effect gizmo that will stopStops a visual effects gizmo.
World
Reset world statereset world stateResets the world back to its inital state.
Math
Logic
"=="[a] == [b]"true" if both values are the same.
!=[a] != [b]"true" if both values are not same.
less than symbol [a] [b]"true" if the first value is less than the second value
> [a] > [b]"true" if the first value is greater than the second value
and[a] and [b]"true" if both values are true.
notnot [a]toggles a boolean value from true to false, or false to true. (I think this correct?)
or[a] or [b]"true" if one of the values is true.
Basic Operations
"+"[a] + [b]Returns the sum of two numbers.
- [a] - [b]Returns the difference of two numbers.
* [a] * [b]Returns the result of two multiplied numbers
/ [a] / [b]Returns the result of the first number divided by the second number.
% [a] % [b]Returns the "remainder" of the first number divided by the second number. Useful for making counters that count up to a certain number and then go back to 0.
Basic Math
absabs [n]Returns the positive value of a number. So, abs -10 = 10 and abs 3 = 3.
ceilceil [n]Rounds a decimal number up to the next largest whole number.
clampclamp [value] [min] [max]If the value is less than the smallest number, return the smallest number. If the value is larger than the biggest number, return the biggest number. Otherwise return the value.
floorfloor [n]Rounds a decimal number down to the next smallest whole number.
fracfrac [n]
lerplerp [from] [to] [alpha]Given a minimum number, maximum number, and an interpolated value between those numbers, lerp will return a value that represents the point of the interpolated value.
maxmax [a] [b]Returns the biggest number
minmin [a] [b]Returns the smalles number
sqrtsqrt [n]Returns the square root of a number
Advanced Math
powpow [number] [power]
coscos [radians]Returns the cosine value of a number, from -1.0 to 1.0.
sinsin [radians]Returns the sine value of a number, from -1.0 to 1.0.
tantan [radians]
acosacos [radians]
asinasin [radians]
atan2atan2 [y] [x]
expexp [power]
log10log10 [number]
random number with decimalsrandom between [min] and [max]Returns a value that can contain fractional decimals, between the first number and the second number.Note: This is inclusive of the [min] value and inclusive of the [max] value.
random numberrandom integer between [min] and [max]Returns a whole number value, between the first number and the second number.Note: This is inclusive of the [min] value and exclusive of the [max] value.
2d perlin noise2d perlin noise [x] [y]Returns a number value based on the perlin noise algorithm.
Object Transformation
position of objectposition of [o]
rotation of objectrotation of [o]
scale of objectscale of [o]
velocity of objectvelocity of [o]
forward direction of objectforward direction of [object]
upward direction of objectupward direction of [object]
Vector Math
new vector from xyznew vector [x] [y] [z]
x of vectorx of [vector]
y of vectory of [vector]
z of vectorz of [vector]
normalizenormalize [vector]
dotdot [a] [b]
crosscross [a] [b]
distance todistance from [a] to [b]
magnitude ofmagnitutde of [vector]
reflectreflect [vector]
new rotation from xyznew rotation [pitch] [yaw] [roll]
look atlook towards [forward] with up [up]
Color
new color from rgbnew color [r] [g] [b]
rgb to hsvconvert rgb to hsv [color]
hsv to rgbconvert hsv to rgb [color]
get object colorcolor of [o]
Player
Position of player[head] position of [player]Can specify head, torso, left hand, right hand, and foot position of a player.
Forward of player[head] forward of [player]Can specify head, torso, left hand, right hand, and foot forward of a player.
Name of playername of [player]Returns the username of a player.
Text
Length of stringlength of [string]Returns the length of a string.
Variable as string[string] as stringConverts other variables that aren't strings into strings. This is useful when concatenating values that aren’t strings together.
Values
set toset [variable] to [value]
Debuggingdebug printdebug print [value]
Value Input
self(self)Represents the object that the script is attached to.
number input(number [0])A number value.
boolean input[boolean [false])A boolean value.
vector input(vector [0] [0] [0])A vector3 value.
rotation input(rotation [0] [0] [0])A rotation value.
color input(color [1] [1] [1])A color value.
string input(string [.])A string value.
Was this answer helpful?

Spawn

Learn how to create and edit spawn points in your world.

A spawn point represents the player's size and where they will spawn or respawn in the world.

To use the Spawn Point gizmo:

  1. From Build Mode, select the Three Line icon > Build icon > Gizmos.

  2. Grab the Spawn Point gizmo. You can now edit the properties by grabbing the gizmo and selecting the Three Dot icon with your controller.

Turning on Spawn on Start to make a particular spawn point the location where players will initially land when they first enter the world.

Was this answer helpful?

Portal


The Portal gizmo is used to teleport players from one world to another.

To use the Portal gizmo:

  1. From Build Mode, select the Three Line icon > Build icon > Gizmos.

  2. Grab the Portal gizmo and pull it into your world. You can now edit the properties by grabbing the gizmo and selecting the Three Dot icon with your controller.



While using a portal, keep in mind:

  • Both worlds must be published

  • Make sure to enter the exact name of both the creator and the world you're linking to.

  • Make sure the creator doesn't have two worlds with the same name.

  • Users of your world need to touch the portal to teleport.

Was this answer helpful?

Text


The Text gizmo lets you display text in your world. You can use the Paint tool to change the text's color.

To use the Text gizmo:

  1. From Build Mode, select the Three Line icon > Build icon > Gizmos.

  2. Grab the Text gizmo and pull it into your world.

  3. Edit the text, color and size by grabbing the gizmo and select the Three Dot icon with your controller.

Was this answer helpful?

Sound Recorder


The Sound Recorder gizmo lets you record custom sounds from the mic on your headset. Each recording can be up to 30 seconds long.

To record a sound:

  1. From Build Mode, select the Three Dot icon > Build icon > Gizmos.

  2. Grab the Sound Recorder gizmo and pull it into your world.

  3. While holding the gizmo, select the Three Dot icon > select Record.

  4. Make a sound > Select Stop to stop recording > Select Play to preview the recording.


You can also adjust the following properties for your sound:

  • Looping: Turn this on to loop the sound continuously.

  • Volume: This will adjust the volume your sound is played at inside your world.

  • Pitch: Use this to adjust the playback speed.

  • Play on Start: Turn this on to have the sound start playing as soon as a player enters the world.

  • Global: Turn on this property to make the sound heard globally at the same volume regardless of a player's position in the world. Turning Global off means the sound will be perceived as coming from the gizmo's location in the world.

  • Minimum Distance: The distance (in meters) at which a sound will be heard at maximum volume.

  • Maximum Distance: The distance (in meters) at which a sound will no longer be heard.

Was this answer helpful?