Login Register
Everyday Commands: Managing Your Project

Modify Commands for Changing Existing Elements

Estimated reading: 0 minutes 9 views

Modify commands change existing objects: positions, rotations, scales, component properties, names, and active states. The standout feature is dot-path property traversal for reaching nested values deep inside components.

Key commands:

  • transform.set — Sets position, rotation, or scale. Change one or all three in a single call.
  • component.add — Adds a component with optional initial properties via JSON and dot-path notation.
  • component.set — Sets a property value on an existing component. Supports dot-path traversal for nested properties.
  • object.rename — Changes a GameObject’s name.
  • object.active — Toggles active/inactive state.

Dot-path traversal: component.set can reach into nested properties:

  • material.color — Material’s main color
  • material._Metallic — Metallic shader property
  • material._BaseColor — URP base color

Max depth is configurable (default 5) in Dashboard Settings.

Auto-loading materials: When a value ends with .mat, GameCatalyst loads the material asset automatically.

Example: “Make the player heavier and freeze rotation.” Vex calls:

  1. component.set target="Player" component="Rigidbody" property="mass" value=5
  2. component.set target="Player" component="Rigidbody" property="constraints" value="FreezeRotation"

Component properties with dot-path:

The dot-path feature in component.set is one of GameCatalyst’s most powerful capabilities. It lets Vex reach into deeply nested component properties using dot notation. For example, material.color traverses from the Renderer to its material to the color property. material._BaseColor accesses URP shader properties. material._Metallic controls metallic values. The maximum traversal depth is configurable (default 5 levels) in Dashboard Settings to prevent runaway property chains.

Object selectors:

Modify commands accept multiple ways to identify the target object: by name (target="Player"), by instance ID, by global object ID, or by object path in the hierarchy. Vex typically uses the object name, but when there are multiple objects with the same name, the more specific selectors help target exactly the right one.

Batch modifications:

You can ask Vex to modify many objects at once. “Set all enemies to inactive” results in Vex finding all enemy objects with object.find and calling object.active for each one. Vex handles the iteration automatically.

Transform shortcuts:

The transform.set command is flexible — set just position, just rotation, just scale, or any combination in a single call. You say “move the player to 0, 5, 0 and scale it to 2” and Vex handles both changes in one command. This saves round-trips and keeps operations efficient.

Share this Doc

Modify Commands for Changing Existing Elements

Or copy link

CONTENTS
Antimanual

Ask our AI support assistant your questions about our platform, features, and services.

You are offline
Chatbot Avatar
What can I help you with?