Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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

    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?