# Playing part of an animation xml file

**URL:** https://forum.castle-engine.io/t/playing-part-of-an-animation-xml-file/432
**Category:** Uncategorized
**Created:** [October 8, 2021, 5:40pm UTC](https://forum.castle-engine.io/t/playing-part-of-an-animation-xml-file/432 "2021-10-08T17:40:05Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [October 19, 2021, 10:22pm UTC](https://forum.castle-engine.io/t/playing-part-of-an-animation-xml-file/432/10 "2021-10-19T22:22:35Z")

</div>

> [@Carring](#):
>
> Now I get TTimeSensorNode error.  
> I have uploaded a new attachment. I just need to play the sequence of the 4 animation names that are in the sprite xml screen. Can you please help me with the code? I got my game animation stuff almost complete except playing sequences of animations.

The first step was to make `RunAllAnimations` running, so that my example from [Play all animations in sequence - #8 by michalis](https://forum.castle-engine.io/t/play-all-animations-in-sequence/315/8) works.

Please first make sure it works – that you have a working `RunAllAnimations`, in a simple test application.

Try to understand that code. Code from the outside should not call `RunNextAnimation`, this doesn’t make sense – `RunNextAnimation` is just a helper method, we need it as a the `Params.StopNotification` callback. Code from the outside should only call `RunAllAnimations`. I emphasize: make sure it works, and play with this code so you understand what it does.

Once you got it, the next step is to change `RunAllAnimations` into something like `RunAnimationSequence` . It should take, as arguments, the Scene, and the list of animation names, and look like

```auto
procedure xxx.RunAnimationSequence(const Scene: TCastleSceneCore; const Names: array of String);
begin
  ..// implementation should be similar to RunAllAnimations, but you have to initialize new AnimList with the contents of Names
end;

```

The only thing you have to do is initialize `AnimList` to be

- a new instance of `TStringList`
- to contain a copy of `Names: array of String`

---

_[View the full topic](https://forum.castle-engine.io/t/playing-part-of-an-animation-xml-file/432)._
