# Trim the range of an animationGroup

**URL:** <https://forum.babylonjs.com/t/trim-the-range-of-an-animationgroup/22546>\
**Category:** Questions\
**Tags:** animation\
**Created:** [July 22, 2021, 8:47am UTC](https://forum.babylonjs.com/t/trim-the-range-of-an-animationgroup/22546 "2021-07-22T08:47:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/flo/32/26919_2.png) [@flo](https://forum.babylonjs.com/u/flo)\
**Post date:** [July 22, 2021, 8:47am UTC](https://forum.babylonjs.com/t/trim-the-range-of-an-animationgroup/22546/1 "2021-07-22T08:47:49Z")

</div>

Hey!  
I’m looking for a simple way to trim the range of an animation group. Any Ideas?

**Example:**  
I have an _animation group: A with the frame range: 0-100_ imported from a .glb which has targeted animations . I wanna create an _animation group: B frame 0-50_ and _animation group: C with frames 51-100_.

Currently Im using the ‘from’, ‘to’ options from [animationGroup.start()](https://doc.babylonjs.com/typedoc/classes/babylon.animationgroup#start) to play the desired range. But I think it would be cleaner to have multiple animationGroups with the desired ranges.

I understand, typically you would do it in the content creation tool. Like mentioned [here](https://forum.babylonjs.com/t/multiple-animations-in-gltf-from-c4d-split-animations-in-babylon/15139). But lets assume this is not an option.

Thanks in advance!

I hope I didn’t overlooked something during my research:

- [how to split animation groups](https://forum.babylonjs.com/t/split-animationgroup-to-subanimations/8111)

- [demystifying animation groups](https://www.youtube.com/watch?v=BSqxoQ-at24)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 22, 2021, 9:13am UTC](https://forum.babylonjs.com/t/trim-the-range-of-an-animationgroup/22546/2 "2021-07-22T09:13:13Z")

</div>

I guess you would need to create new animations by copying the range of keys you want, then create an `AnimationGroup` around them. That seems a bit of work to do programmatically (there’s no direct way to create an `Animation` by extracting a range of keys)… If you really want two animation groups, you can clone the first one, but of course you will still need to do `animGroup2.start(..., 51, 100)`.
