diff --git a/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java b/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java index 226c363b3c..963292ba64 100644 --- a/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java +++ b/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java @@ -54,7 +54,12 @@ public boolean isIntersected(SimpleCollisionBox other) { @Override public CollisionBox copy() { - return new ComplexCollisionBox(boxes.length, boxes); + ComplexCollisionBox copy = new ComplexCollisionBox(boxes.length); + for (int i = 0; i < maxLength; i++) { + copy.boxes[i] = boxes[i].copy(); + } + copy.maxLength = this.maxLength; + return copy; } @Override