Commit ·
2c1dd82
1
Parent(s): 3cee53a
Fix: Clone materials on agent death to prevent transparency bugs on other agents
Browse files
frontend/static/index.html
CHANGED
|
@@ -1954,6 +1954,10 @@ function initScene() {
|
|
| 1954 |
ac.scale.setScalar(ac.userData.deathTimer);
|
| 1955 |
ac.traverse(child => {
|
| 1956 |
if (child.material) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1957 |
child.material.transparent = true;
|
| 1958 |
child.material.opacity = Math.min(child.material.opacity || 1.0, ac.userData.deathTimer);
|
| 1959 |
}
|
|
|
|
| 1954 |
ac.scale.setScalar(ac.userData.deathTimer);
|
| 1955 |
ac.traverse(child => {
|
| 1956 |
if (child.material) {
|
| 1957 |
+
if (!child.userData.materialCloned) {
|
| 1958 |
+
child.material = child.material.clone();
|
| 1959 |
+
child.userData.materialCloned = true;
|
| 1960 |
+
}
|
| 1961 |
child.material.transparent = true;
|
| 1962 |
child.material.opacity = Math.min(child.material.opacity || 1.0, ac.userData.deathTimer);
|
| 1963 |
}
|