Linking JavaScript Files – API Reference

By |

Linking JavaScript Files

The Buildbox JavaScript panel allows you to link a custom node script to a JavaScript file on your computer, allowing you to use an external text editor to update and change your custom node script. Whether you update the file in the Buildbox JavaScript panel or external editor, it will be updated in both locations

To access the JavaScript panel, on an asset’s node map, double-click a node or click its edit icon.

To link a file to the JavaScript panel, click Link File at the bottom-right of the JavaScript panel, and depending on whether you need to export the file from or import it to Buildbox, choose one of the following procedures below.

Export to File & Link
  1. Select Export File & Link. The Save As window appears.
  2. Select the location where you want to save the file.
  3. Name the file and click Save.

A JavaScript file with the custom node script is now created locally on your computer and is linked to your custom node inside Buildbox.

Import from File & Link
  1. Select Import from File & Link.
  2. On your computer, navigate to the JavaScript file that contains your custom node script.
  3. Click Open.

The script from your JavaScript file appears in the Buildbox JavaScript panel and is linked to your local file.

To avoid breaking the link to your JavaScript file, avoid moving or renaming the JavaScript file on your computer, or deleting the linked node in Buildbox,

After you link a JavaScript file to a node, click the icon at the bottom right of the JavaScript panel to view the following options:

Option Description
Open Externally Opens the linked JavaScript file using your default script editor.
Show in Folder Opens the folder that contains the linked JavaScript file.
Export to File & Link Creates and saves a JavaScript file that contains your custom node script locally on your computer and links the file to the Buildbox JavaScript panel.
Import from File & Link Imports and creates a link to a JavaScript file from your computer to the Buildbox JavaScript panel.
Unlink Unlinks the JavaScript file from the Buildbox JavaScript panel. The updates will no longer be synchronized.

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?

Haptic Feedback Node – Buildbox 3 Manual

By |

Haptic Feedback Node

This action node activates a low or high vibration level on a mobile device.

This node contains two inputs that control different levels of the device vibration:

  • Low—activates a quick and light vibration.
  • High—activates a longer and more intense vibration.

If needed, type a custom name for this node in the name attribute.

Signal Threshold Node – Buildbox 3 Manual

By |

Signal Threshold Node

This action node activates any connected node inputs after this node activates the amount of times specified by the Threshold amount.

After you add this node to an asset:

  1. Connect the In input to the desired node’s output.
  2. Connect the Out output to the desired node’s input.
  3. Select this node, and In the options panel, in the Threshold field, enter the amount of times you want the player to activate this node before activating the nodes connected to the Out output.

The following example requires players to press a keyboard button three times to change the asset’s color. Since the Threshold amount is set to 2, the player needs to press the keyboard button twice to fulfill that amount, and once more to activate the Set Color node.

Node Attributes

Option Description
Name Enter a custom name for this node, if needed.
Threshold Enter amount of times you want this node to activate before it can activate any connected nodes.
Single Event Select this checkbox to require the In input to activate by the Threshold amount once. After the Threshold amount has been fulfilled, the Out output will activate any connected nodes when In input activates.

If needed, you can also customize this node. For details, see Customizing Nodes.

Signal Invert Node – Buildbox 3 Manual

By |

Signal Invert Node

This action node inverts the signal received from a connected node. For example, if the In input receives a true signal, the Out output sends a false signal.

Each node output sends a true or false signal that node inputs receive. A true signal allows an input to enable a nodes action while a false signal disables that action. When this node’s In input receives a signal from a different node’s output, the Out output sends the opposite signal to any connected node inputs.

To change the name of the node, select it in the node map and in the Options panel, in the Name field, type a custom name, if needed.

The image below is an example a keyboard button that when pressed, stops the asset’s current movement.

If needed, you can also customize this node. For details, see Customizing Nodes.

Signal Node – Buildbox 3 Manual

By |

Signal Node

This action node sends a true or false signal through a connector to activate or deactivate any connected inputs on other nodes.

The Out output sends the signal when the asset is created or spawned in the game, much like the Object Start node.

To change the type of signal to send: in the options panel, select the Signal attribute field and choose one the following options:

  • True—activates connected inputs.
  • False—deactivate connected inputs.
This node can be used for organizing the node map by minimizing the amount of connections to the Start node.

The following is an example of a Signal node connected to a Move node. A True signal will make the asset move, while a False signal will not.

If needed, you can also customize this node. For details, see Customizing Nodes.

Velocity Drag Node – Buildbox 3 Manual

By |

Velocity Drag Node

This movement node applies physics resistance to a dynamic asset’s movement and rotation.

Before you add this node to an asset, you need to set it’s physics to Dynamic.

Node Attributes

Option Description
Name Type a custom name for this node, if needed.
Positional Drag Enter a decimal value between 0 and 1 in each axis field to apply resistance to an asset’s movement when affected by gravity or colliding with other objects. A value of 1 completely prevents the asset from moving with physics.
Rotational Drag Enter a decimal value between 0 and 1 in each axis field to apply resistance to an asset’s rotation when affected by gravity or colliding with other objects. A value of 1 completely prevents the asset from rotating with physics.

8 Sided Animation Node – Buildbox 3 Manual

By |

8 Sided Animation Node

This content node changes an asset’s 2D animation based on the asset’s direction of movement or the direction it faces in a 3D World.

To apply animations to an asset that change based on the asset’s movement, do the following:

  1. Select the Mode attribute to determine when you want the animation to change.
    • Position Change—the asset’s movement in the X and Z direction.
    • Rotation Change—the asset’s rotation along the Y axis.
  2. Drag a PNG image sequence to each animation fields. The animation will change when the asset moves or rotates in the following directions:
    Attribute Direction Axis Direction
    Up Forward Negative Z
    Up Right Forward Right Negative Z and Negative X
    Down Backward Positive Z
    Down Left Backward Left Positive Z and Positive X
    Left Left Positive X
    Up Left Forward Left Negative Z and Positive X
If the asset moves in a direction that does not contain an animation in its field, the current animation will continue to play.

Circular Move Node – Buildbox 3 Manual

By |

Circular Move Node

This movement node makes an asset orbit around a specific point in a scene.

If the asset is gradually descending or falling, make sure its physics is not set to Dynamic.

Node Attributes

Option Description
Name Type a custom name for this node, if needed.
Seconds Per Orbit Enter the number of seconds it will take for the asset to complete a full circle.
Radius Enter a numeric value to specify the radius of the orbit. The higher the number, the wider the orbit
Center Enter a numeric value in any of the axis fields to offset the center of the orbit.

For example, if the asset’s position in a scene is 0, 0, 0, and the Center is set to 0, 5, 0, then the center of the asset’s orbit will be 5 units higher than its original scene position.

Reverse Direction Select to reverse the direction of the movement.
Plane Select the plane the asset will orbit in.

  • XY—clockwise/counterclockwise along a horizontal plane.
  • XZ—forward/backward along a horizontal plane.
  • YZ—forward/backward along a vertical plane.

If needed, you can also customize this node. For details, see Customizing Nodes.

Gravitate Node – Buildbox 3 Manual

By |

Gravitate Node

This movement node allows a dynamic asset to move and gravitate toward other assets in a scene.

To make an asset gravitate toward another asset, do the following:

  1. In a World workspace and in the Asset panel, double-click the asset to open it’s Node Map.
  2. On the Node Map grid, select the Start node and in the options panel on the right, click the Physics field and select Dynamic.
  3. In the Node panel on the left and in the Search fiexld, type Gravitate and drag the name or icon to the Node Map grid.
  4. On the Gravitate node, connect the Enabled input to the Created output of the Start node.
  5. Select the Gravitate node and in the Options panel on the right, adjust the Strength attribute as needed.
  6. Preview your game. The asset will now gravitate toward another asset in the scene.

Node Attributes

Option Description
Name Type a custom name for this node, if needed.
Strength Enter the amount of strength to determine how quickly the asset will gravitate toward another asset. The higher the number, the faster the asset will gravitate.

If needed, you can also customize this node. For details, see Customizing Nodes.

Stick to Edge Node – Buildbox 3 Manual

By |

Stick to Edge Node

This advanced node maintains an asset’s position and size in relation to the screen size.

This node only works with  UI Screens assets and will overwrite the current the asset’s position in the UI Editor.

This node automatically enabled when the asset is created or spawned in the game.

After you add this node to a UI asset, you need to specify the following:

  • Select the Side attribute to specify which side of the screen you want to place the asset, then specify the Horizontal and Vertical Distance depending on which side you chose.
  • The following lists each Side option as well as the Distance attributes you need to specify.
    • Bottom—Vertical
    • BottomLeft—Horizontal & Vertical
    • BottomRight—Horizontal & Vertical
    • Left—Horizontal
    • Right—Horizontal
    • Top—Vertical
    • TopLeft—Horizontal Dist. & Vertical
    • TopRight—Horizontal & Vertical

Node Attributes

Option Description
Name Type a custom name for this node, if needed.
Horizontal Dist. The distance measured from the right or left side of the screen to the asset’s center.
Vertical Dist. The distance measured from the top or bottom side of the screen to the asset’s center.
Side Select the side of the screen that the distance attributes will be measured from.

If needed, you can also customize this node. For details, see Customizing Nodes.