Multiple objects share animation timer

Topics: Developer Forum
May 23, 2007 at 8:21 AM
Hi again.

I have new issues that I think this awfully quiet forum can help me with. I have classes with ModelAnimators in them but when I create multiple objects of those classes and they end up in the same animation state, they are animated the same way at the same time.
I have two enemies of the same type with the same ModelAnimator and one of them is in the state "walk" and the other one is in the state "attack". Before the attacking enemy chops the player up with his attack animation the first enemy gets close enough to the player and switches state to "attack" as well.
Now one would think that the first enemy would strike first and then the other player would strike. That is not the case however. They both strike simultaneously. I believe this has to do with the fact that they have similar modelmeshes and therefor similar modelanimators. They do not however have the same modelanimator since they are different instances of the same class....

Any idea to what the problem could ever be?
Jun 6, 2007 at 11:41 PM
You could use the EffectInstancedAnimator, which may or may not be in the latest release.

Or you could set Enabled = false and Visible = false and manually call update and draw for each in your form's draw method.