API

Function AnimationCreateAndStartHierarchyAnimation

  • Create and start an animation on a node and its descendants

    Parameters

    • name: string

      defines the name of the global animation that will be run on all nodes

    • node: Node

      defines the root node where the animation will take place

    • directDescendantsOnly: boolean

      if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used

    • targetProperty: string

      defines property to animate

    • framePerSecond: number

      defines the number of frame per second to use

    • totalFrame: number

      defines the number of frames in total

    • from: any

      defines the initial value

    • to: any

      defines the final value

    • OptionalloopMode: number

      defines which loop mode you want to use (off by default)

    • OptionaleasingFunction: EasingFunction

      defines the easing function to use (linear by default)

    • OptionalonAnimationEnd: () => void

      defines the callback to call when an animation ends (will be called once per node)

    Returns Nullable<Animatable[]>

    the list of animatables created for all nodes

    https://www.babylonjs-playground.com/#MH0VLI