Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Access Camera in CameraSensor

Discussion in 'ML-Agents' started by guidosalimbeni, Jun 4, 2020.

  1. guidosalimbeni

    guidosalimbeni

    Joined:
    Nov 10, 2017
    Posts:
    17
    Hi,
    How can I assign a camera at runtime to the slot in camera sensor? I got an error saying that I cannot get a component using get component in unity if it not derives from monobehaviour. I used get component with the interface Isensor but I don't know how to assign a camera at runtime from here. Any help would be great..
    thanks
     
  2. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    289
    nofreewill42 likes this.
  3. nofreewill42

    nofreewill42

    Joined:
    Feb 3, 2019
    Posts:
    5
    Using one camera in a CameraSensorComponent I successfully get an observation in a Jupyter notebook.
    What I want however is to have two cameras so that I can research in 3D vision.
    When I have two cameras in two separate CameraSensorComponents, however, and call "env.reset()", it is stuck with showing the asterisk that the cell is running.
    Does anybody know what may be wrong?