Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use a camera after being used in a camera sensor #6113

Closed
SmlHugod opened this issue May 9, 2024 · 3 comments
Closed

Can't use a camera after being used in a camera sensor #6113

SmlHugod opened this issue May 9, 2024 · 3 comments
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@SmlHugod
Copy link

SmlHugod commented May 9, 2024

Describe the bug
I have an HUD with a Render Texture bind to a camera called Camera 2. So in game, I have the main Camera View and a little view of Camera 2.
If I decide to use Camera 2 in a Camera Sensor, then in game my Camera 2 dissapears

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple project with 2 cameras displayed in the Game view (for example a main camera + a Raw Image using the other camera as a background texture in a Canvas).
  2. Click on play : we see both cameras.
  3. Now create an agent and add him a camera sensor using Camera 2.
  4. Click on play : the camera dissapears.

Environment (please complete the following information):

  • Unity Version: Unity 2023.2.25f1
  • OS + version: Windows 11
  • ML-Agents version: ML-Agents release 21
  • Torch version: 2.2.2+cu121
@SmlHugod SmlHugod added the bug Issue describes a potential bug in ml-agents. label May 9, 2024
@miguelalonsojr
Copy link
Collaborator

This is intended functionality. You can re-enable the camera to be used beyond collecting observations in the CameraSensor component by checking the "Runtime Camera Enable".

Screenshot 2024-05-09 at 11 53 46 AM

@SmlHugod
Copy link
Author

Oh thank you so much. I feel so dumb !

@miguelalonsojr
Copy link
Collaborator

Glad it worked out. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a potential bug in ml-agents.
Projects
None yet
Development

No branches or pull requests

2 participants