Built-in attribute API
Read or edit engine-owned attributes on the behavior entity or a named scene object.
When to call it
Use attributes for built-in entity state. Prefer set_translation for Position and set_enabled for Enabled when those dedicated calls better express intent.
Calls
rustic.get_attribute(name)rustic.edit_attribute(name, value)rustic.game.Scene.Root.Child.EditAttribute(name, value)
Variables
| Variable | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name, Position, Size, Color (RGB), CanTouch, CanCollide, Anchored, or Parent. |
value | attribute-specific | Yes | Value matching the attribute type. |
Return and timing
Get returns the current value. Edit queues a typed mutation.
Language examples
Lua 5.4
lua
local name = rustic.get_attribute('Name')
rustic.edit_attribute('Color', {1, .5, 0})JavaScript
javascript
const name = rustic.get_attribute('Name');
rustic.edit_attribute('Color', [1, .5, 0]);Python
python
name = rustic.get_attribute('Name')
rustic.edit_attribute('Color', [1, .5, 0])C++
cpp
auto name = rustic.get_attribute("Name");
rustic.edit_attribute("Color", color);C#
csharp
string? name = (string?)rustic.get_attribute("Name");
rustic.edit_attribute("Color",new double[]{1,.5,0});Luau
lua
local name = rustic.get_attribute('Name')
rustic.edit_attribute('Color',{1,.5,0})C
c
RusticValue name = rustic.get_attribute("Name");
rustic.edit_attribute("Color",(RusticValue){.type=RUSTIC_VECTOR,.vector={1,.5,0},.length=3});Java
java
String name = (String)rustic.get_attribute("Name");
rustic.edit_attribute("Color",new double[]{1,.5,0});PHP
php
$name = $rustic->get_attribute("Name");
$rustic->edit_attribute("Color",[1,.5,0]);HTML / inline JS
javascript
const name = rustic.get_attribute('Name');
rustic.edit_attribute('Color', [1, .5, 0]);Constraints and behavior
- In Play, unanchored built-in primitives fall under gravity; CanCollide enables solid box response only when both objects enable it. Anchored prevents physics movement and clears velocity on the next fixed tick. CanTouch does not affect solids; no collision or touch callbacks are emitted. Imported meshes do not simulate yet. See the Basic physics guide for setup and limits. Unknown attributes and type changes are rejected. Parent accepts a stable entity ID or null. Target another object with rustic.game.Scene.Root.Child:EditAttribute in Lua, native member calls in JavaScript/Python/C#/PHP, C++ subscripts, or an edit_attribute protocol command containing source. See Edit scene objects for setup, native calls in every language, and runtime limits.
- Every gameplay language calls the engine-owned API. Rustic supplies SDKs and dispatches callbacks; scripts do not parse requests or serialize responses. See the language guide for complete setup and callback registration.