Problem with multiple models of the same type

May 1, 2008 at 6:27 AM

i create a class of my models that has it's own independent modelanimator
with just object is fine or lots of objects of the different kind of models are fine too
but whenever i created the same object of the same model each of those models follow the action of the 1st model

RunController(myObject0.zAnimator, myObject0.zAni_walk);
RunController(myObject1.zAnimator, myObject1.zAni_attack);
RunController(myObject2.zAnimator, myObject2.zAni_die);

with the following code all of my 3 objects does the "zAni_walk"


ANOTHER PROBLEM

I keep seeing the model at Vector3.ZERO when i didn't draw it so i don't know where it came from and couldn't do anything about it
i tried looking but don't have any idea where it came from

Thx in advance
May 16, 2008 at 6:07 PM
Check out EffectInstancedAnimator.cs...  basically what's happening is that your effects are being shared.  That is each model/mesh/meshpart has a reference to the same effect object.

In ModelAnimator.cs the model is added to the game's component lists.  Addition to this list will cause the model's draw function to be executed.
May 19, 2008 at 8:11 AM


missileControl wrote:
Check out EffectInstancedAnimator.cs...  basically what's happening is that your effects are being shared.  That is each model/mesh/meshpart has a reference to the same effect object.

In ModelAnimator.cs the model is added to the game's component lists.  Addition to this list will cause the model's draw function to be executed.



Hi,

I have been trying to use the EffectInstancedAnimator to play animations. However, I don't see my model anymore when I do. It works fine when using ModelAnimator. I am using the XNA 2.0 version of the library (someone posted on this forum). I'm not sure if that could be causing the problem or not?

Any suggestions will be greatly appreciated.

Cheers,
Steven.