Manual: Execute Action "Change Object Property"

In this execution action, you can modify the following three main types of data:

  1. Object variables/switches
  2. Database data (this also includes project-wide variables/switches)
  3. Properties of each node

Let’s explain each in detail.

1. Object Variables/Switches

You can modify the variables/switches stored in the SwitchSettings/VariableSettings nodes of each object.
However, the following variables/switches are read-only and cannot be changed.

Type Name
Switch is_locked, is_touching_portal
Variable object_id, stayed_area_id, visible_direction, x_speed, y_speed, player_id, controller_id, taken_damage

Why Read-Only Variables/Switches Exist

They exist to support the “Switch/Variable Changed” condition under Related Link Conditions. Since property values cannot be used directly as conditions, they are stored as linked switches/variables.

2. Database Data

You can modify user database entries, project variables, and project switches.
Note that type presets and sound databases cannot be accessed via this execution action.

Option to Specify Records Using Variables

This option allows you to specify a record (row) using an object variable.
If the specified variable’s value is 5, the 5th record from the top of the specified column (row) will be selected.

For example, when creating a state that displays information about obtained items by creating an item database, using this option allows you to achieve this with a single state. Without this option, you would need branching equal to the number of item IDs.

3. Properties of Each Node

You can modify the values of properties for any node, not just those specific to ACTION GAME MAKER.
In principle, any property can be overwritten. For example, the following operations are possible:

  • Enable the acceleration movement property in MoveAndJumpSettings to switch movement types.
  • Modify the Visible property of Sprite2D to hide it.
  • Enable the Disabled property of HitCollision to disable collision detection.
  • Replace the text of a Label node with string data from the database to display different text.

Behavior When Targeting Parent Objects

When targeting a parent object, the system does not perform scene validation for the target.
Therefore, even if the parent object belongs to a different scene than specified, the action will function correctly as long as the same items exist.
This allows you to create common child objects, such as those used for damage detection.

:warning: Important Notes When Using the “Change Property” Action

Changing the order of user variables/switches/nodes may cause misalignment of targets.

This is due to Godot’s limitation, where changes are made using Index (order) specification.
The action modifies the X-th property from the top.
Therefore, if you delete and shift up a user variable in the middle or swap nodes, all references in the configured actions will become misaligned.

If you move the target scene within the file system, change the filename/folder name, or perform similar actions when targeting locked objects or specified objects, the action will no longer function correctly.

This is because the path to each target scene is specified as a “string.”
While Godot normally updates paths automatically when scenes are moved within the file system, the paths specified in ACTION GAME MAKER actions are plain “strings” and are not updated automatically.
This measure is in place to avoid Godot’s powerful recursive loop detection/blocking system.