away3d/away3d-core-fp11 — Issue #204: Adding a shadow on a cloned character makes the characters share the same animation
Author: makaimedia
Created: 2012-01-04 17:59:39+00:00
State: open

Very strange bug.

Steps:

Load an MD5 animation and create controllers for each one using a clone:

(Zombie class is just an extended ObjectContainer3D)

for (var i:int = 0; i < totalZombies; i++)
{
var newZombie:Mesh = Mesh(zombieMesh.clone());
newZombie.castsShadows = false;
var zombie:Zombie = new Zombie();
zombie.animator = new SmoothSkeletonAnimator(newZombie.animationState as SkeletonAnimationState);
zombie.position = new Vector3D(totalZombies*100 - (i * 50), 10, -400+Math.random()*100);
zombie.animator.timeScale = 2.3 + (Math.random()*3);
zombie.mesh = newZombie;
scene.addChild(zombie);
zombies.push(zombie);
}

Change the castsShadows to true.

Observe that the clones now share the same animations and cannot be controlled separately.