# Disposing Targeted Animation

**URL:** <https://forum.babylonjs.com/t/disposing-targeted-animation/22096>\
**Category:** Questions\
**Created:** [July 2, 2021, 2:28pm UTC](https://forum.babylonjs.com/t/disposing-targeted-animation/22096 "2021-07-02T14:28:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sidharth\_Suresh](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sidharth\_Suresh](https://forum.babylonjs.com/u/Sidharth_Suresh)\
**Post date:** [July 2, 2021, 2:28pm UTC](https://forum.babylonjs.com/t/disposing-targeted-animation/22096/1 "2021-07-02T14:28:12Z")

</div>

Hi,  
How can I dispose targeted animations which are a child of Animation groups (as shown in Inscpector) through code? I am able to dispose them through inspector.

I basically want to dispose the animation targeted to a mesh without disposing the mesh.

---

<div class="post-metadata">

**Author:** ![syntheticmagus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syntheticmagus/32/395_2.png) [@syntheticmagus](https://forum.babylonjs.com/u/syntheticmagus)\
**Post date:** [July 2, 2021, 6:28pm UTC](https://forum.babylonjs.com/t/disposing-targeted-animation/22096/2 "2021-07-02T18:28:26Z")

</div>

Hi Sidharth\_Suresh,

One of the great things about Babylon is that all the source is public, including that of the Inspector itself; so in this case, since we know the Inspector does what you’re looking for, we can look into the Inspector source and see how it does this.

[Babylon.js/targetedAnimationPropertyGridComponent.tsx at 5e6321d887637877d8b28b417410abbbeb651c6e · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/blob/5e6321d887637877d8b28b417410abbbeb651c6e/inspector/src/components/actionTabs/tabs/propertyGrids/animations/targetedAnimationPropertyGridComponent.tsx#L46-L60)

Since this is what the Inspector is doing, I think this likely the most recommended approach. Does this work in your scenario?

---

<div class="post-metadata">

**Author:** ![Sidharth\_Suresh](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sidharth\_Suresh](https://forum.babylonjs.com/u/Sidharth_Suresh)\
**Post date:** [July 2, 2021, 7:03pm UTC](https://forum.babylonjs.com/t/disposing-targeted-animation/22096/4 "2021-07-02T19:03:53Z")

</div>

Hey Syntheticmagus,  
Thank you for answering. I think I have a different problem, what I was looking for doesn’t seem to help me. Anyway, thanks for sharing the resource, will definitely help in the future.
