From cccb8a8716718094aeb9cc44572c260b840e6cac Mon Sep 17 00:00:00 2001 From: vincentpierre Date: Thu, 1 Apr 2021 11:44:52 -0700 Subject: [PATCH] [bug fix] Fix warning using demo recorder --- com.unity.ml-agents/Runtime/Agent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.ml-agents/Runtime/Agent.cs b/com.unity.ml-agents/Runtime/Agent.cs index b50f6a82d3..6c056c541a 100644 --- a/com.unity.ml-agents/Runtime/Agent.cs +++ b/com.unity.ml-agents/Runtime/Agent.cs @@ -572,7 +572,6 @@ void NotifyAgentDone(DoneReason doneReason) // Request the last decision with no callbacks // We request a decision so Python knows the Agent is done immediately m_Brain?.RequestDecision(m_Info, sensors); - ResetSensors(); // We also have to write any to any DemonstationStores so that they get the "done" flag. foreach (var demoWriter in DemonstrationWriters) @@ -580,6 +579,8 @@ void NotifyAgentDone(DoneReason doneReason) demoWriter.Record(m_Info, sensors); } + ResetSensors(); + if (doneReason != DoneReason.Disabled) { // We don't want to update the reward stats when the Agent is disabled, because this will make