---
title: Create a Rule to combine properties
product: SpeedTree Modeler
version: '10'
latest_version: '10'
status: This page documents version 10. The latest version is 10.
canonical: https://docs.unity.com/en-us/speedtree-modeler/10/rules-combine-properties
latest_url: https://docs.unity.com/en-us/speedtree-modeler/10/rules-combine-properties.md
last_updated: 2026-11-19
generated_at: 2026-11-19T15:06:04.781Z
locale: en-us
---

# Create a Rule to combine properties

> Compose a Rule to manipulate two properties of your model at the same time, using a slider that combines the trunk height and radius of an existing tree model.

This procedure builds a single slider that adjusts both the trunk height and radius of an existing tree model together, working up through the following sections.

> **Note:**
>
> To get proper and meaningful results from this example Rule, you need to use a tree with a first level branch generator named "Trunk" that can afford a height value between 20 and 80 and a trunk radius value between 0.2 and 1.2. For example, use the Conifer available in the Samples provided with the Modeler.

## Create a slider with a normalized range

1. From the menu, select **Window** > **Rules**.

2. In the script editor of the [Rules window](./rules-window.md), compose the following statement:

   ```lua
   GrowthValue = rule("Growth", 0.5, 0.0, 1.0)
   ```

3. Click anywhere outside the Rules window.

The UI section of the Rule window displays a slider named **Growth** in a section named **Shape**. The slider allows you to change the value of a variable named `GrowthValue` between `0` and `1` and the default value is `0.5`.

## Make the slider proportionally control the trunk height

1. Create and isolate a local `TrunkHeight` variable and interpolate its value in a suitable range according to the slider's range.

   ```lua
   GrowthValue = rule("Growth", 0.5, 0.0, 1.0)

   do
     local TrunkHeight = math.lerp(20, 80, GrowthValue)
   end
   ```

   In this example, the `math.lerp` function makes the `TrunkHeight` variable value linearly change between `20` and `80` when you move the slider between between `0` and `1`.

2. Select the Trunk generator of the tree.

3. In the Property Bar, select the **Spine** tab.

4. Under **Spine** > **Length**, right-click on the **Absolute** property and select **Copy edit line for script**.

5. Under the local variable statement in the Rule editor, paste the copied information.

6. Update the `VALUE` parameter of the `set_property_value` function to match the Rule's variable name (`TrunkHeight`):

   ```lua
   GrowthValue = rule("Growth", 0.5, 0.0, 1.0)

   do
     local TrunkHeight = math.lerp(20, 80, GrowthValue)
     set_property_value("=Trunk", "Spine:Length:Absolute", TrunkHeight)
   end
   ```

7. Click anywhere outside the Rules window.

When you adjust the slider, the trunk of the tree gets longer or shorter.

## Combine the trunk radius with the trunk height

1. Create a local `TrunkRadius` variable and interpolate its value in a suitable range according to the slider's range.

   ```lua
   GrowthValue = rule("Growth", 0.5, 0.0, 1.0)

   do
     local TrunkHeight = math.lerp(20, 80, GrowthValue)
     local TrunkRadius = math.lerp(0.2, 1.2, GrowthValue)
     set_property_value("=Trunk", "Spine:Length:Absolute", TrunkHeight)
   end
   ```

   In this example, the `math.lerp` function makes the `TrunkRadius` variable value linearly change between `0.2` and `1.2` when you move the slider between between `0` and `1`.

2. Select the Trunk generator of the tree.

3. In the Property Bar, select the **Skin** tab.

4. Under **Skin** > **Radius**, right-click on the **Absolute** property and select **Copy edit line for script**.

5. Under the first `set_property_value` statement in the Rule editor, paste the copied information.

6. Update the `VALUE` parameter of the new `set_property_value` function to match the Rule's variable name (`TrunkRadius`):

   ```lua
   GrowthValue = rule("Growth", 0.5, 0.0, 1.0)

   do
     local TrunkHeight = math.lerp(20, 80, GrowthValue)
     local TrunkRadius = math.lerp(0.2, 1.2, GrowthValue)
     set_property_value("=Trunk", "Spine:Length:Absolute", TrunkHeight)
     set_property_value("=Trunk", "Skin:Radius:Absolute", TrunkRadius)
   end
   ```

When you adjust the slider, the trunk height and radius values get higher or lower at the same time.

## Additional resources

* [Introduction to Rules](./rules-introduction.md)
* [Anatomy of a Rule](./rules-anatomy.md)
* [Create a simple slider Rule](./rules-create-slider.md)
* [Rule script helpers in the Property bar](./property-bar.md#rule-script-helpers)
* [SpeedTree functions usable in Rules](./rules-speedtree-functions.md)
* [Lua scripting reference documentation](https://www.lua.org/manual/)
