Skip to content

Commit 272899a

Browse files
[bug fix] Fix warning using demo recorder (#5216)
1 parent 18ff7bc commit 272899a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

com.unity.ml-agents/Runtime/Agent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,15 @@ void NotifyAgentDone(DoneReason doneReason)
572572
// Request the last decision with no callbacks
573573
// We request a decision so Python knows the Agent is done immediately
574574
m_Brain?.RequestDecision(m_Info, sensors);
575-
ResetSensors();
576575

577576
// We also have to write any to any DemonstationStores so that they get the "done" flag.
578577
foreach (var demoWriter in DemonstrationWriters)
579578
{
580579
demoWriter.Record(m_Info, sensors);
581580
}
582581

582+
ResetSensors();
583+
583584
if (doneReason != DoneReason.Disabled)
584585
{
585586
// We don't want to update the reward stats when the Agent is disabled, because this will make

0 commit comments

Comments
 (0)