Overview
Theset_calculated_property tool allows you to set property values using mathematical formulas. This is powerful for creating patterns, sequences, or calculations based on existing properties or custom variables.
Parameters
Array of instance paths to modify. Each path uses dot notation (e.g.,
game.Workspace.Part1)Name of the property to set (e.g.,
Position, Transparency, Size)Mathematical formula to calculate the property value. Can reference existing properties and variables.Examples:
"index * 50"- Multiply instance index by 50"Position.Y + 10"- Add 10 to current Y position"size * 2"- Double a custom variable"math.sin(index) * amplitude"- Sine wave pattern
Additional variables available in the formula. Optional.Example:
Built-in Variables
The formula has access to these built-in variables:index- The index of the current instance in the paths array (0-based)Position- Current Position property (for Vector3 operations)Size- Current Size property- Any current property of the instance can be referenced by name
math- Lua math library (sin, cos, abs, floor, ceil, etc.)
Vector3 Handling
When setting Vector3 properties, you can:-
Calculate entire Vector3: Return an object
-
Calculate single component: Use component notation
-
Reference Vector3 properties: Access X, Y, Z components
Examples
Sequential positioning
Place platforms at increasing distances:Creating a transparency gradient
Sine wave pattern
Scaling based on position
Relative height adjustment
Alternating pattern
Use Cases
- Creating evenly spaced object patterns
- Generating gradients (transparency, color, size)
- Building staircases with calculated heights
- Creating wave or spiral patterns
- Applying mathematical sequences to properties
- Generating procedural variations
Formula Tips
Error Handling
Related Tools
- set_relative_property - Simpler relative modifications
- mass_set_property - Set same value on multiple instances
- set_property - Set a single instance property