Open MarkTension opened 2 years ago
Hi - This could be a timing issue in combination with the serialized GridBuffer.Shape. I did serialize a default value for it in order to prevent a null reference in the CreateSensors() method. It is invoked by the ml-agents code when the associated agent is enabled - regardless of whether you're in edit or runtime mode. My guess is your sensor is created before you are overriding the sensor buffer at runtime, and therefore it keeps using the serialized value. As a workaround, you can try keeping the agent disabled until you've set the new value. I'm aware this is less than ideal though...
Thank you. Keeping the agent disabled didn't work for me. But I hacked an extra line in GridSensorComponent class when (GridBuffer == null), I hardcode it. Not very pretty, but it works
GridShape = new GridBuffer.Shape(8, 23, 23);
Hello, my gridsensor somehow doesn't initialize corerctly.
It says the sensor shapes don't match, but I do specify a colorgridbuffer with a shape (23, 23, 8) like so:
customGridSensor.cs
I'm not sure where 20,20,1 comes from. When I hard-code the GridSensorComponentBase script, where the (20,20,1) comes from, then it sometimes works. But other times it still gives the same error
GridSensorComponentBase .cs
When it works, all looks good in the debugging visualization. Is there a way to fix this, or did I forget anything? Thanks!