Using an index (PB only)Use an index to assign or obtain a value for a specific dimension of a vector. An index is a number in brackets following a vector that specifies a certain dimension. Numbering starts at 0, so the first dimension is specified by 0, the second is specified by 1, and so on. By using an index, you can vary one dimension while keeping the others the same. In the following example, the value 35 is assigned to the second dimension (or y-coordinate) of the position vector in the Knob layer, creating a keyframe: value (Knob, position) [1] = 35; In another example, the current value of first dimension (or x-coordinate) of the Position property in the boat layer is assigned to the variable M1: M1 = value (boat, position) [0]; In this example, the variable M1 contains only a single value. In addition to using numbers to specify an index, you can use x and y with a two-dimensional vector, as shown in the following example: Loc2 = value (car, position) [x]; The letter x is equivalent to the index 0, and the letter y is equivalent to the index 1. |