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

Resolved Recorder gives error when starting recording programmatically

Discussion in 'Audio & Video' started by KayH, Mar 23, 2023.

  1. KayH

    KayH

    Joined:
    Jan 6, 2017
    Posts:
    110
    I'm using Unity 2021.3.21f1, Recorder version is 3.0.3.

    I have a script that is supposed to automatically start a recording with RecorderWindow.StartRecording. But I get some errors:

    When I start a recording by pressing the according button in the editor tab, it works as expected. So the issue only occurs when trying to start the recording programmatically.

    I get the RecorderWindow in the Start function and store it in a variable rw. Then in Update, after preparations have been triggered with a button press I check for a ready state; once reached, I call rw.StartRecording(). This is when the error occurs.
     
  2. rooose

    rooose

    Unity Technologies

    Joined:
    Jun 8, 2022
    Posts:
    30
    Hi KayH,

    Would you mind sharing your RecorderWindow settings and the script you are using to start the recording? I am having some trouble reproducing the issue.
     
  3. KayH

    KayH

    Joined:
    Jan 6, 2017
    Posts:
    110
    Thanks for taking the time to try to reproduce the problem. Turns out I was starting the recording repeatedly because of a missing check for a bool.
     
    rooose likes this.