Description
Describe the bug
I am using RigidBodySensorComponent
to report the positions and velocities of rigid bodies controlled by an agent. The sensor component correctly extracts the items in the hierarchy, but it always enables the whole hierarchy, the base of which is fixed in model space coordinates, and so just extra useless data being passed to the model. There are check boxes to disable these bodies, but they are not saved with the scene, and as soon as I start training, they are all re-enabled again. It looks like there is a settings object set to be serialized, so I'm not sure why they're not being properly trained. This also happens when I make the RigidBodySensorComponent
part of a prefab and change anything there, the settings are not included with the prefab.
To Reproduce
- Create a
GameObject
with aRigidBody
attached. - Create several child
GameObject
s with their ownRigidBody
s. - Attach a
RigidBodySensorComponent
to the root object. - Disable some of the object's in the
RigidBodySensorComponent
's hierarchy settings. - Save the scene, exit and reload it.
Expected behavior: The disabled objects should be saved with the scene and persist across a save and reload.
Actual behavior: The hierarchy always resets to the default of having all the objects enabled.
Environment (please complete the following information):
- Unity Version: 2021.3.7f1 Apple Silicon
- OS + version: macOS Monterey 12.5 (21G72) running on Apple Silicon
- ML-Agents version: Latest
main
branch from source - Torch version: 1.13.0.dev20220804
- Environment: Crawler. Try disabling one of the bodies in the
RigidBodySensorComponent
attached toCrawlerBase
in thePlatform
prefab. It will not save once you have exited prefab mode.
NOTE: We are unable to help reproduce bugs with custom environments. Please attempt to reproduce your issue with one of the example environments, or provide a minimal patch to one of the environments needed to reproduce the issue.