Metric stacking bug fixed

This commit is contained in:
2026-08-03 22:30:30 +02:00
parent acb3d671be
commit d50d5ac14f
+11 -1
View File
@@ -97,7 +97,12 @@ class MetricsHUD:
)
def reset(self) -> None:
"""Clears text reference on environment reset."""
"""Removes the active debug text item so a new episode starts with a clean overlay."""
if self._text_id is not None:
try:
p.removeUserDebugItem(self._text_id, physicsClientId=self.client_id)
except Exception:
pass
self._text_id = None
@@ -134,4 +139,9 @@ class LeaderCrown:
)
def reset(self):
if self._text_id is not None:
try:
p.removeUserDebugItem(self._text_id, physicsClientId=self.client_id)
except Exception:
pass
self._text_id = None