I would need to see the testcase to reproduce the issue, to help better.
In general, playing animations in our engine definitely works, for looping or not looping animations. And it is simplest to play them using MyScene.PlayAnimation
. See our docs that show using scenes and PlayAnimation
:
- Tutorial: Designing a 3D world | Manual | Castle Game Engine
- Writing code to modify scenes and transformations | Manual | Castle Game Engine
And see examples, like examples/animations/play_animation/.
( Using the MyScene.AnimationTimeSensor(...).Start
makes also sense, but only if you want to play multiple simultaneous animations on the same model, like in examples/animations/simultaneous_animations_one_scene/ . )
Looking at the other thread, it seems you are unsure how to create instances of a class. And in above example, X
must be valid for the call X.AnimationTimeSensor('Anim').Start
to work. So
- double-check you have created / assigned
X
properly. - And double-check you actually have the animation with given name, so
X.AnimationTimeSensor('Anim')
is not nil. - (And preferably, just use
X.PlayAnimation('Anim')
which is simpler and advised in most cases.)