🍣Properties

Assigning and managing property mappings

Properties map to a specific value or field with a component or material. This provides the means to apply animations and behaviors to game objects.

Adding Channels with Properties

When adding a property-based channel or behavior, the context menu displays a list of component properties on the object, shown below.

Note that only properties on the current game object are displayed in the context menu.

Submenus are organized by component, each listing the properties that can be animated, followed by the target attribute (if it is a complex value, such as a vector or color).

Alphabetical Sorting

Properties are listed in alphabetical order, with longer lists divided into submenus starting with the first letter of the property name. These names are defined by the script or object they belong to.

Property lists are created automatically using System.Reflection to discover all writable fields filtered by type to expose only values which Timeflow can animate. All others are hidden including internal editor variables which shouldn't be animated.

For further on this topic, see Property Handlers.

Discovering Properties To explore properties it is recommended to look at the code in question, or to use Debug Mode in the Inspector to display all component properties. Holding the Alt key while in the Inspector reveals the internal names of fields.

Assigning Properties

When a channel is selected, its property assignment is displayed in the Info Panel or in the Inspector view. Clicking the main button (displaying the current assigned property name) displays a drop-down menu to select another property.

A typical property display

Properties may be changed at any time and reassigned from one value type to another. When the value has multiple attributes (such as a vector or color), an extra drop-down menu is displayed on the right to select the attribute, or choose Combined or Uniform Value, described in more detail below.

Attribute (X,Y,Z)

Any property type with more than one value is displayed with the option to select a single attribute or all. An attribute in this case refers to a specific axis (X, Y, Z, W) or color channel (R, G, B, A) or other attribute particular to the data type.

Combined

Instead of a single attribute, you can use Combined mode to animate the whole complex value. For example, when animating an object's position, this allows each keyframe to store a 3d coordinate (Vector3). Each attribute is displayed with a separate curve in the Graph View, however the attributes share the same keyframe time and interpolation.

Separate vs Combined Adding each attribute (X,Y,Z) as a separate channel provides more control since each channel has its own independent keyframes. However, a single combined channel is more convenient for some value types, such as when animating colors.

Uniform Value

This mode assigns the same value to each attribute (ex: XYZ = 1,1,1). This mode is most commonly used for scale values to maintain uniform scale.

Data Types

Timeflow properties support all standard numerical types as well as objects and strings.

Float

A single floating point value.

Integer

All integral data types are supported, including enumerations. Interpolation is supported with integer types, however produces stepped results.

Boolean

Boolean values can only be on or off (true or false).

Vector

Vector values can range from 2 to 4 attributes (X, Y, Z, W)

Color

Color values have 4 attributes (R, G, B, A).

Rect

Rect values are similar to vectors but with slightly different attributes (X, Y, W, H)

String

String values control text properties.

Strings and object types do not interpolate but change immediately when the keyframe is reached. Although the keyframes can be moved vertically in the graph view, it has no effect on the animation.

Component

Use this type to animate component reference fields.

GameObject

Animates references to game objects.

Textures

Animates texture references.

Data-Only Properties

Instead of mapping to a field value, a property may instead be used to hold data of any type. A data-only property has no direct output other than to store and/or generate a value which can be used for calculations using Channel Link or other scripting method.

A data-only assignment may also be used to temporarily bypass normal output while still keeping the channel alive and continuing to produce output values for other channels to reference.

Cross-Object References

Properties by default relate to the current game object, however may target properties on other game objects in the scene.

To assign a different object, drag and drop it in the reference field. It must be an object in the scene.

Scripting Custom Properties

Timeflow automatically discovers all serialized fields in MonoBehaviour-based components. However, when you need to animate a value that is not directly accessible, such as a static field, a Scriptable Object, or a custom data type, then you'll need to write a simple script to expose the value.

using AxonGenesis;
using UnityEngine;

[ExecuteInEditMode]
public class CustomPropertyExample : MonoBehaviour
{
    [Tooltip("Animate this Value to control your custom type")]
    public float Value;

    private class MyCustomType
    {
        public void SetValue(float value)
        {
            Debug.Log("Value: " + value);
        }
    }

    private MyCustomType myCustomType;

    void Start()
    {
        myCustomType = new MyCustomType();
    }

    void Update()
    {
        // Pass the value to your custom type or method
        myCustomType.SetValue(Value);
    }
}

Above is an example script showing how to animate a value which isn't directly accessible in the properties menu. This script can be added to a game object and then animated to control the underlying value.

Property Errors and Unassigned Properties

If you encounter a warning icon or an "(Unassigned)" property, it simply means that the property mapping is invalid or not found. This can be solved by clicking on the red button to select a property from the menu displayed.

Last updated