Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class AnimStateGraph

    An asset resource which represents an anim state graph. It can be loaded into an anim component using the AnimComponent#loadStateGraph method.

    The graph is data, not behavior. It lists its layers, each with its states, the transitions between them and their conditions, and the parameters those conditions read. Loading it into a component builds the runtime AnimState, AnimTransition and AnimBlendTree objects, and AnimComponent#assignAnimation then attaches an AnimTrack to each state. One graph can drive any number of components.

    Scripts can retrieve an AnimStateGraph instance from assets of type 'animstategraph'. An AnimStateGraph can then be loaded into an anim component as follows:

    const animStateGraph = app.assets.get(ASSET_ID).resource;
    const entity = new Entity();
    entity.addComponent('anim');
    entity.anim.loadStateGraph(animStateGraph);