Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: nakker101 on October 22, 2016, 11:08:38 PM
-
Hello to everybody.Many years passed since the last time I was trying to create a small game. I finaly decided to continue but I have a problem. In a scene there is a music player. I want "On take" to play a music,the 2D actor to go to a dance floor and start dancing and when the music stops I want the actor to stop dancing. The problem is that the music stops but the actor doesn't. The music file is an ogg file. The actor animation is a sprite with looping turn on because the animation is shorter than the music.What is the correct way for telling the game that when this particular music stops,it should stop the actor animation too? Thank you for your time.
-
pseudo code:
-
Thank you s.belov for your answer. I have more questions if you don't mind.My actor is a 2D actor. Can the "actor.IdleAnimName" be used for a 2D actor too? If it can, when you write "actor.IdleAnimName = "dancing";" and "actor.IdleAnimName = "stop dancing";" this "dancing" and "stop dancing" what exactly is it?
-
"dancing " and "stop dancing" are animation sets - which can form part of an actor definition in the same way that "talk" "walk" and "turn" are.
If you want more on this I suggest you read the section on actors in the documentation that comes with the kit.
The other and perhaps easier way to kill an animation is actor.Reset();